javascript - Function doesn't work in safari on windows -
while syntax works on other browser, safari on windows throws error
$("#kibana").contents().find('.navbar-nav')[0].remove(); the error is
typeerror: 'undefined' not function the element exist. checked using debugger.
why happening?
when use [] on jquery object, retrieving underlying dom node. .remove isn't cross-browser compatible on native dom elements.
instead, can use .eq retrieve element while still having wrapped in jquery. way can use cross-browser comptabile .remove method:
$("#kibana").contents().find('.navbar-nav').eq(0).remove();
Comments
Post a Comment