简体   繁体   中英

How can I take the element that appear with toggle

Suppose to have a html page. In this html page there is a button and when I click on the button it appear a toogle where there are a button:

(In the toggle code)

<button id="new">New</button>

I need to remove this button so I use jquery:

$('#new').remove();

But the button doesn't remove. I think because theare is a problem of loading with the js and the toggle. Anyone can help me?

Please put button remove code in document.ready as below. Because of it your code will be executed after page loaded get completed.

$(document).ready(function(){
   $('#new').remove();
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM