0

I'm trying to remove all elements with a specific ID (and children) using jQuery within a WordPress website on page load. I'm using the following with no success:

 <script>
 $(document).ready(function(){    
  $("#contentLeft").remove();
 });
 <script>

There are many pages containing this ID, but there is only one instance per page. Should I place the script in the , before the , after the , etc? Any help would be appreciated.

  • 2
    possible duplicate of [TypeError: 'undefined' is not a function (evaluating '$(document)')](http://stackoverflow.com/questions/7975093/typeerror-undefined-is-not-a-function-evaluating-document) – Gerald Schneider Jun 20 '14 at 18:55
  • 1
    need more info on this...1. check your console for errors (google chrome console/firefox console) 2. where are you adding the code: from a functions file, importing from js file, etc 3. You need no conflict jQuery, you can use the word jQuery instead of $. 4. have you included jquery on the frontend? – David Jun 20 '14 at 19:04

0 Answers0