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 in Web Development by gaurav
• 18,040 points
17 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 by rajatha
• 7,040 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 in Web Development by gaurav
• 18,040 points
12 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 in Web Development by gaurav
• 18,040 points
12 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,740 points
477 views
0 votes
1 answer

jQuery get value of select onChange

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

answered Jun 23 in Web Development by rajatha
• 7,040 points
18 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,500 points
308 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,740 points
8,902 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,740 points
15,899 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,740 points
1,306 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 in Web Development by rajatha
• 7,040 points
8 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 in Web Development by rajatha
• 7,040 points
23 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP