Welcome Guest [Log In] [Register]
We hope you enjoy your visit.

You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free.


Join our community!


If you're already a member please log in to your account to access all of our features:

Username:   Password:
Multiquote (on) Multiquote (off)
Add Reply
Remove certain elements in a webpage?
Topic Started: Aug 29 2009, 04:06 PM (349 Views)
-Neo Metallix-
Member Avatar
Metal Overlord
[ *  *  *  *  * ]
Is there a way to remove certain elements(such as #nav) in a webpage, but only in a specific webpage using a javascript or something?
Offline Profile Quote Post Goto Top
 
Reid-ZNS
Member Avatar
C'est un piège!
[ *  *  *  *  *  * ]
Code:
 
<script type='text/javascript'>
// <![CDATA[
jQuery('#nav').remove();
// ]]>
</script>
Place that on the web page.
Offline Profile Quote Post Goto Top
 
-Neo Metallix-
Member Avatar
Metal Overlord
[ *  *  *  *  * ]
Thank you very much! Now how would I modify it to rid multiple elements?
Offline Profile Quote Post Goto Top
 
Reid-ZNS
Member Avatar
C'est un piège!
[ *  *  *  *  *  * ]
Code:
 
<script type='text/javascript'>
// <![CDATA[
// jQuery("css selector 1, selector 2, etc").remove();
jQuery('#nav, #submenu').remove();
// ]]>
</script>
I left you a small example above that - don't worry, that line is commented out so it won't remove anything unexpectedly.
Offline Profile Quote Post Goto Top
 
1 user reading this topic (1 Guest and 0 Anonymous)
« Previous Topic · ZetaBoards Support · Next Topic »
Add Reply