Pure JS equivalent of Jquery eq

0 votes

What is the pure equivalent of jquery's eq(). For example, how may I achieve

$(".class1.class2").eq(0).text(1254);

in pure javascript?

Jun 22, 2022 in Web Development by gaurav
• 23,260 points
1,092 views

1 answer to this question.

0 votes

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;
answered Jun 23, 2022 by rajatha
• 7,640 points

Related Questions In Web Development

0 votes
0 answers

What's the Zepto equivalent of jQuery.getScript()?

What's the Zepto equivalent of jQuery.getScript()? I ...READ MORE

Jul 25, 2022 in Web Development by gaurav
• 23,260 points
227 views
0 votes
0 answers

Will choosing between YUI or jQuery effect the overal design of .js files?

Will choosing between jquery or YUI change ...READ MORE

Aug 11, 2022 in Web Development by gaurav
• 23,260 points
185 views
0 votes
1 answer

How to change the default delimiter of Handlebars.js?

Instead of changing the delimiters you can ...READ MORE

answered Dec 3, 2020 in Web Development by Niroj
• 82,880 points
954 views
0 votes
1 answer

jQuery get value of select onChange

To get the value and text of ...READ MORE

answered Jun 23, 2022 in Web Development by rajatha
• 7,640 points
875 views
0 votes
1 answer

What is jQuery?

Hey, jQuery is a fast and concise JavaScript ...READ MORE

answered Feb 14, 2020 in JQuery by kartik
• 37,510 points
1,004 views
0 votes
1 answer

Uncaught TypeError: Cannot read property 'msie' of undefined - jQuery tools

Hello, Use the following script tag in your ...READ MORE

answered Apr 28, 2020 in JQuery by Niroj
• 82,880 points
14,320 views
0 votes
1 answer

Uncaught Error: Bootstrap's JavaScript requires jQuery

Hello @kartik, You have provided wrong order for ...READ MORE

answered Apr 28, 2020 in JQuery by Niroj
• 82,880 points
22,476 views
0 votes
1 answer

How to make Bootstrap popover Appear/Disappear on hover instead of click?

Hello @kartik, Set the trigger option of the popover to hover instead ...READ MORE

answered May 12, 2020 in JQuery by Niroj
• 82,880 points
2,990 views
0 votes
1 answer

$("#select option:second").val() jquery - keep select second value of select box option

Yes, you want the special jQuery eq() selector. ...READ MORE

answered Jun 22, 2022 in Web Development by rajatha
• 7,640 points
2,426 views
0 votes
1 answer

jQuery get value of select onChange

Try this- $('select').on('change', function() { alert( this.value ...READ MORE

answered Jun 23, 2022 in Web Development by rajatha
• 7,640 points
428 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP