javascript - Is it possible to create a new dom using select parts from another dom? Or prune away unwanted parts -


i'm wondering if possible load html page display few select parts of it.

two possible approaches come mind:

1) delete parts of dom i'm not interested in. wouldn't know parts are, i'd know parts i'm interested in. possible find parts i'm interested in remove else?

2) create new dom has been made extracting parts of dom original. possible somehow create in parallel existing dom , make browser switch new dom? or alternatively create html page new dom , load that?

are these crazy ideas? simple / alternative solutions?

yes, use javascript/jquery.

first have add jquery library website javascript link so.

<script src="jquery.js" type="text/javascript"/>.  

you need create function similar put onclick event on link.

 <script> function switch(){ $("#button").onclick(function() {  $(".classofcertainelements").css("display", "none");  $(".classotherelements").css("display", "inline"); });  }  </script> <a href="" id="button">click me</a> 

does help?


Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -