Select the text from a CSS selector using jQuery (or javascript) -



Select the text from a CSS selector using jQuery (or javascript) -

running in console:

$('#background-experience h4 a')

returns list of:

<a href='someurl.com' name='something' title='title class='class>some text</a>

how select first element list , "some text"?

$('#background-experience h4 a').text()

returns of "some text".

$('#background-experience h4 a')[0].text()

breaks error:

$('#background-experience h4 a')[0].text() uncaught typeerror: string not function

$('#background-experience h4 a').text();

to select first element list , "some text-

$('#background-experience h4 a:eq(0)').text()

javascript jquery css

Comments

Popular posts from this blog

assembly - What is the addressing mode for ld, add, and rjmp instructions? -

vowpalwabbit - Interpreting Vowpal Wabbit results: Why are some lines appended by "h"? -

Is there a way to convert an HTML page styled with Bootstrap CSS into email-compatible html? -