के अंदर jQuery चयन बटन (ओं) मैं एक डीवीवी के अंदर मौजूद बटनों का एक विशिष्ट समूह चुनना चाहता हूं और पेज पर एक छिपे हुए फ़ील्ड को अपना आईडी असाइन करना चाहता हूं लेकिन मैं अपने जीवन के लिए बटन का चयन नहीं कर सकता div .. उदाहरण में विफल रहता है नीचेdiv
स्रोत HTML
<div id = test>
<div class="ButtonGroupWrapper">
<img src="test.jpg" width="100" height="100" alt="thumbnail" />
<input id="buttonID5" type="submit" value="Link" class="button" />
</div>
<div class="ButtonGroupWrapper">
<img src="test.jpg" width="100" height="100" alt="thumbnail" />
<input id="buttonID6" type="submit" value="Link" class="button" />
</div>
</div>
jQuery चयनकर्ता विफल रहता है
$(".ButtonGroupWrapper").find(":button").click(function() {
alert("hi there");
return false;
});
$("#ButtonGroupWrapper input[type=button]").click(function() {
alert("hi there");
return false;
});
$("#ButtonGroupWrapper :button").click(function() {
alert("hi there");
return false;
});
आपको बहुत बहुत धन्यवाद। मैं पहले व्यक्ति के साथ बदल गया: बटन से: $ ("बटन समूह समूह") सबमिट करें। ("सबमिट करें")। (फ़ंक्शन() { अलर्ट ("हाय वहाँ") पर क्लिक करें; झूठी वापसी; }); – RenRock