185145/pure-js-equivalent-of-jquery-eq
What is the pure equivalent of jquery's eq(). For example, how may I achieve
$(".class1.class2").eq(0).text(1254);
in pure javascript?
To get the element index in the array you can use [] in javascript. So to reproduce your code you can use this:
document.querySelectorAll('.class1.class2')[0].textContent = 1254;
What's the Zepto equivalent of jQuery.getScript()? I ...READ MORE
Will choosing between jquery or YUI change ...READ MORE
Instead of changing the delimiters you can ...READ MORE
To get the value and text of ...READ MORE
Hey, jQuery is a fast and concise JavaScript ...READ MORE
Hello, Use the following script tag in your ...READ MORE
Hello @kartik, You have provided wrong order for ...READ MORE
Hello @kartik, Set the trigger option of the popover to hover instead ...READ MORE
Yes, you want the special jQuery eq() selector. ...READ MORE
Try this- $('select').on('change', function() { alert( this.value ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.