Reputation: 4646
I am not sure how to select the input below using Javascript selectors. I tried this but that doesn't seem to be correct:
$("input:text[name=[11235]");
<div class="Row-LineDetail A" id="Row1235">
<span class="Col-Label LineIndent1">
</span>
<span class="Col-Dollar">
<input type="text" name="l1235" value="$5,000.00" cols="8" onkeyup="validateNegAmount(this);" onblur="transform(this)" onfocus="removeFormatters(this);this.select();">
</span>
</div>
Upvotes: 0
Views: 81
Reputation: 15860
Simply use
$('input[name=l1235]');
If you want to select the text elements, then you can ues
$('input[type=text]');
Other queries can be executed after this such as:
if($(this).attr('name') == 'l1235') {
And so on! :)
Upvotes: 0
Reputation: 770
with using jquery
$('input[name="l1235"]')
with pure javascript
document.getElementsByName('l1235')
Upvotes: 0
Reputation: 2011
You'll want something like this:
$("input[name='11235']");
Take a look at http://api.jquery.com/category/selectors/attribute-selectors/ for more information about attribute selectors.
Upvotes: 0
Reputation: 94429
Since you appear to be using jQuery the following would work:
$("input[name='l1235']")
Upvotes: 0
Reputation: 2903
$('input[name="l1235"]')
That would work if you are using jQuery, as in your example above.
Upvotes: 1