Insert an image inside an element through its class (HTML + JavaScript)

Example: CodePen Code: <div class=”myClass”></div> <script> document.addEventListener(‘DOMContentLoaded’, function() { document.getElementsByClassName(“myClass”)[0].innerHTML = “<img alt=’my image’ src=’http://astralmemories.com/img/astral-memories-logo.png’>”; }, false); </script>

Continue Reading →

Accordion with effect (HTML + JavaScript)

Example: https://codepen.io/astralmemories/pen/drEypr Code: <style> .ui-accordion-content a:link, .ui-accordion-content a:hover, .ui-accordion-content a:active, .ui-accordion-content a:visited {   color: #428bca; } </style> <link href=”https://code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css” rel=”stylesheet”>…

Continue Reading →