javascript - adding a new section on webpage using only css and js -


i trying click on image on webpage , open new section on page created in css , javascript/jquery. thought using .addclass() not entirely sure how go it. can give me example of being done?

an example clicking on element id foo , adding div id bar after element:

$("#foo").click(function(){     $(this).after('<div id="bar">some content</div>'); }); 

of course, there multiple methods in jquery insert content somewhere in dom tree, see:

https://api.jquery.com/category/manipulation/dom-insertion-outside/

https://api.jquery.com/category/manipulation/dom-insertion-inside/


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -