Search code examples
jqueryprototypejs

find() and attr() in prototypejs


What are equivalent of jQuery function find() and attr() in prototypejs?

Could someone help me to convert this code using prototypejs?

var className = $(this).find('.myBtn').attr('class');
$(this).find('.tab').attr('class', className + ' current');

Thanks in advance!


Solution

  • You can use .down() to find a descendant and readAttribute()/writeAttribute() to read/modify attributes.

    Or you could simply stay with jQuery. ;)