Find and input byt its class and value with JQUERY -
i have input:
<input type="hidden" class="code" value="22015054">
and want find it. selector:
var inputv = $('input.code input[value=22015054]');
in console have this:
console.log(inputv.html()); "null"
but not work, how can solve this??
please help.
your current selector targeting input
element child of input.code
element.
what appears want select input element class code , value of 22015054.
to that, you'd write following selector: 'input.code[value=22015054]'
here example outputs html element matched input
element div.
$('#output').text($('input.code[value=22015054]')[0].outerhtml);
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <input type="hidden" class="code" value="22015054"> <div id="output"></div>
so, code become:
var inputv = $('input.code[value=22015054]'); console.log(inputv);
Comments
Post a Comment