0

Im trying to get the value of a selected object in a table.

the id's are auto generated like to resemble this

( status1, status2, status3....)

I use the following to extract the row id

var $row = this.id.match(/\d+/); // Extract number to get row id

and then I want to concatenate that row id to get the value of the column, like this

var $hasID = $("hasid"+$row).val();

but $hasID remains UNDEFINED

1 Answer 1

3

Prefix # when using ID selector. Since match will return you an array use [0] to get first element.

Use

var $hasID = $("#hasid" + $row[0]).val();
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.