89
rated 0 times
[
95]
[
6]
/ answers: 1 / hits: 30114
/ 10 Years ago, sun, september 21, 2014, 12:00:00
This question may be duplicate of any. But, after lot of try I couldn't find the proper solution for this.
This is my code
@Styles.Render(~/Content/css)
@Scripts.Render(~/bundles/modernizr)
@Scripts.Render(~/bundles/jquery)
@Scripts.Render(~/bundles/bootstrap)
<script>
$(document).ready(function () {
var els = document.querySelectorAll('body > *');
els[els.length - 1].remove(); //getting error here
})
</script>
I don't know why my application is showing error in browser console like
TypeError: els[els.length - 1].remove() is not a function
When i can run same function in browser console window and it works. but, when i place my code in the page it shows me error like above. I have also tried to call .removeNode(boo)
method but, it was also not working. Actually when i try to write ele[].remove()
in the code the intellisence doesn't suggest me that function.
More From » jquery