How can you logically group HTML elements without taking the help of CSS classes ?
- by Perpetualcoder
I know that in jQuery you can use something like $(".cssClass") to get all elements with this class. However in plain html and javascript how do you group elements logically? For example:
<input id="fee1" data-id="1" data-group="Fees" type="text" value="$15.00"/>
<input id="fee2" data-id="2" data-group="Fees" type="text" value="$25.00"/>
<input id="fee3" data-id="3" data-group="Fees" type="text" value="$35.00"/>
I want to create a javascript function like this:
function GetByDataGroup(dataGroup){
/* returns something like [[1,"$15.00"],[2,"$25.00"],[3,"$35.00"]]*/
}
EDIT : Due to some political reasons I cant use jQuery or any framework..i know it doesnt make sense :)