Search code examples
jqueryprototypejs

What is the equivalent of jQuery function in Prototypejs?


What is the equivalent of jQuery's

closest() function in prototypeJS?

and html() function in prototypeJS?


Solution

  • 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
    

    http://www.prototypejs.org/api/element/update