javascript - jQuery to extract 'Click Me' from <a href="http://example.com">Click Me</a> -


my code looks this..

$(row).children("td").eq(index).html() 

and gives me:

<a href="http://example.com">click this</a> 

from console taking above element

var item = $(row).children("td").eq(index); item[0].innertext() // outputs "click me" doesn't work in app. 

but doesn't work in js in rails app , generates error.

how structure code outputs 'click me' im wanting?

for background i'm developing rails4 app , using coffeescript, don't think that's relevant here.

[edit 1:] when use code:

$(row).children("td").eq(index)[0].text()

produces error:

'uncaught typeerror: undefined not function' 

it's table sorter i'm building. i'm addressing fact sorter working fine table entries built plain text, eg city field, it's incorrectly sorting name field processing whole field string.

i need able have extract text field within address tag if there 1 , otherwise sort on text field if sort field not within address tag.

try following:

$(row).children("td").eq(index).text() 

here relevant doc: http://api.jquery.com/text/


Comments

Popular posts from this blog

python - mat is not a numerical tuple : openCV error -

c# - MSAA finds controls UI Automation doesn't -

wordpress - .htaccess: RewriteRule: bad flag delimiters -