JavaScript ParseInt/text/value from <strong> element parseint text value

I've having trouble parsing integers or even text from <strong> elements on a page. What I want to do is parse the number of followers from a Twitter profile, like this one. Using Google dev tools, I'm calling:

var value = ($('.js-mini-profile-stats strong')[2])

Than I'm trying to call value.text() but... oops!

TypeError: Object #<HTMLElement> has no method 'text'

How do I get text from this element and then parse the integer from it? Unfortunately, the text inside the <strong> element has the format 1,353,441, so calling parseInt directly will only get value 1 from it.

Edit: Thanks for answers. But stilL I can't parse int from it

`value.text();
"=> 1,992,740"
parseInt(value.text());
 => 1`
Answer:1

when you apply index to jquery object you get simple html element
so if you want get text in side this element i need use

var value = $('.js-mini-profile-stats strong')[2].innerText.replace(/,/g,"")

OR

var value = $('.js-mini-profile-stats strong')[2].innerHTML.replace(/,/g,"")

also you can use jquery

var value = $('.js-mini-profile-stats strong:eq(2)').text().replace(/,/g,"")

and then parse it like

val = parseInt(value, 10);
Answer:2

I am trying to set the state (actiu) of multiple components to false, referring to them via the class. How can I achieve that when I click a Label from a row, the actiu state of all the elements in ...

I am trying to set the state (actiu) of multiple components to false, referring to them via the class. How can I achieve that when I click a Label from a row, the actiu state of all the elements in ...

  1. reactjs setstate multiple properties
  2. reactjs setstate multiple
  3. react js multiple setstate

I've generated html and I need to restructuring the html using Jquery, like this: Original: <table id="myTableID"> <tr id="tr01"> <td>Col 1 Value</td> </tr> <tr ...

I've generated html and I need to restructuring the html using Jquery, like this: Original: <table id="myTableID"> <tr id="tr01"> <td>Col 1 Value</td> </tr> <tr ...

  1. jquery move to another page
  2. jquery move to another div
  3. jquery move element another
  4. jquery move element after another
  5. jquery move element to another parent
  6. jquery move element to another div
  7. jquery move element before another
  8. jquery move div after another div
  9. jquery move div to another parent
  10. jquery move element into another
  11. jquery move div before another div
  12. jquery move div into another div
  13. jquery move element inside another
  14. jquery move div inside another div
  15. jquery move node to another parent
  16. jquery move html to another div
  17. jquery move button to another div
  18. jquery move li to another ul
  19. jquery move child to another parent
  20. jquery move tr to another table

Hi I have an array like this. var i; for(i=0;i<10;i++){ $('<input/>').attr('type','text') .attr('name','TxtBx_[]') .attr('id','TxtBx_' + i) ...

Hi I have an array like this. var i; for(i=0;i<10;i++){ $('<input/>').attr('type','text') .attr('name','TxtBx_[]') .attr('id','TxtBx_' + i) ...

  1. array length using javascript
  2. array length using jquery
  3. array length using
  4. length array in c
  5. length array in php
  6. length array in python
  7. length array in javascript
  8. length array in java
  9. length array in js
  10. length array in typescript
  11. length array in numpy
  12. length array in
  13. length array in variable
  14. length of array using sizeof
  15. length of array using pointers
  16. length of array using php
  17. length of array using python
  18. array length in node js
  19. array length in swift
  20. array length in powershell

Why doesn't the name function work. The chrome console outputs 'string is not a function'? Please provide the answer. Thanks <html> <head> <script type="text/javascript"> ...

Why doesn't the name function work. The chrome console outputs 'string is not a function'? Please provide the answer. Thanks <html> <head> <script type="text/javascript"> ...

  1. doesn't
  2. doesn't matter
  3. doesn't make sense
  4. doesn't equal sign
  5. doesn't remind me
  6. doesn't phase me
  7. doesn't really matter
  8. doesn't faze me
  9. doesnt afraid of anything
  10. doesn't synonym
  11. doesn't make sense now
  12. doesnt remind me chords
  13. doesn't suffer fools
  14. doesn't feel like christmas
  15. doesn't matter lyrics
  16. does not exist
  17. does not work
  18. does not equal
  19. doesn't care
  20. doesn't affect you