What is the equivalent of jQuery's
closest() function in prototypeJS
and html() function in prototypeJS
Thank you so much.
What is the equivalent of jQuery's
closest() function in prototypeJS
and html() function in prototypeJS
Thank you so much.
You might want to read getOffsetParent
for closest()
and update
for html()
I think the .html() function looks like this in prototype
To retrieve the html
$('fruits').innerHTML;
// -> '<ul id="favorite"><li>kiwi</li><li>banana</li><li>apple</li></ul>'
To change the html
$('fruits').update('kiwi, banana and apple');
// -> HTMLElement
jQuery's html() can set and retrieve html text whereas, prototype has not such equivalent. Prototype has only
update()which can set html of an element. There is no method to retrieve html text like jQuery. However, using innerHTML, we can get and set html text.
jQuery's closest() can be replaced by prototype up() method, as per my understanding.
Thank you so much for all of your support.