Quick question, is this code possible?
function respond (primary_id) {
var answer = $('id_of_' + primary_id).val();
}
I’ve tested it out but the error produced does not directly point to this line of code, but another that is using this variable answer so I can’t be sure if this is causing the problem or something else. If this can’t work, then what is an alternative?
Would point to all elements:
Which don’t exist in any version of HTML I’ve seen…
If you’re looking for an element with that ID,
Would be the way to go.
Also, don’t forget to return the value: