मैं चेकबॉक्सग्रुप 'लोकटम्स' के माध्यम से लूप करना चाहता हूं और सभी चयनित मानों के साथ एक स्ट्रिंग का निर्माण करना चाहता हूं। इसलिए जब चेकबॉक्स 2 और 4 का चयन किया जाएगा तो परिणाम होगा: "3,8"
<input type="checkbox" name="locationthemes" id="checkbox-1" value="2" class="custom" />
<label for="checkbox-1">Castle</label>
<input type="checkbox" name="locationthemes" id="checkbox-2" value="3" class="custom" />
<label for="checkbox-2">Barn</label>
<input type="checkbox" name="locationthemes" id="checkbox-3" value="5" class="custom" />
<label for="checkbox-3">Restaurant</label>
<input type="checkbox" name="locationthemes" id="checkbox-4" value="8" class="custom" />
<label for="checkbox-4">Bar</label>
मैंने यहाँ जाँच की: http://api.jquery.com/checked-selector/ लेकिन इसके नाम से चेकबॉक्स समूह का चयन करने का कोई उदाहरण नहीं है।
मैं यह कैसे कर सकता हूँ?