admin管理员组文章数量:1399887
How can I get value of textbox appended with image tag. There is list of images with class="hi" and textbox with class multiple.
<div id="images">
<img src="www.xyz/qwert.jpg" class="hi">
<input type="text" class="multiple">
<img src="www.xyz/qwerty.jpg" class="hi">
<input type="text" class="multiple">
<img src="www.xyz/qwertww.jpg" class="hi">
<input type="text" class="multiple">
</div>
How can I get src and value of textbox ?
Script I tried:
var values = "";
$(".hi, .multiple").each(function () {
imageURI = $(this).attr('src'); // I am getting imageURI
???? //How can I get texbox value?
});
How can I get value of textbox appended with image tag. There is list of images with class="hi" and textbox with class multiple.
<div id="images">
<img src="www.xyz./qwert.jpg" class="hi">
<input type="text" class="multiple">
<img src="www.xyz./qwerty.jpg" class="hi">
<input type="text" class="multiple">
<img src="www.xyz./qwertww.jpg" class="hi">
<input type="text" class="multiple">
</div>
How can I get src and value of textbox ?
Script I tried:
var values = "";
$(".hi, .multiple").each(function () {
imageURI = $(this).attr('src'); // I am getting imageURI
???? //How can I get texbox value?
});
Share
Improve this question
edited Apr 14, 2015 at 7:32
Brijesh Bhatt
3,8303 gold badges20 silver badges34 bronze badges
asked Apr 14, 2015 at 7:15
Nehil MistryNehil Mistry
1,1092 gold badges23 silver badges51 bronze badges
0
3 Answers
Reset to default 5$(".hi").each(function () {
var imageURI = $(this).attr('src');
var textBoxVal = $(this).next().val();
});
$(".hi").each(function () {
var imageURI = $(this).attr('src');
var textBoxVal = $(this).next('input').val();
});
Try this:
var values = "";
$(".hi, .multiple").each(function () {
imageURI = $(this).attr('src'); // I am getting imageURI
textBoxVal = $(this).val();
});)
本文标签: javascriptMultiple class Get each valueStack Overflow
版权声明:本文标题:javascript - Multiple class Get each value - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744242252a2596843.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论