<select name="vehicle_make" onchange="test1(this.value)" style="width: 130px; float:left;" id="vehicle_make" class="home_input">
<option value="">Choose Make</option>
<option value="2063">Acura</option>
<option value="2064">Honda</option>
</select>
I have a drop down list. I read the href attribute of the link and assigned it as a value for the drop down list. but I want to take only the number from the link and assign it as a value for the drop-down list of how I can do this.
<select name="vehicle_make" onchange="test1(this.value)" style="width: 130px; float:left;" id="vehicle_make" class="home_input">
<option value="">Choose Make</option>
<option value="http://store.teknotik.com/category-s/2063.htm">Acura</option>
<option value="http://store.teknotik.com/category-s/2064.htm">Honda</option>
</select>
I used the following jquery to get the link as value
$("#data a").each(function(index) {
if ($(this).attr("class") == "subcategory_link") {
//document.getElementsById("year").innerHTML="<option value="+$(this).attr("href")+">test</option>";
lnk[cnt] = $(this).attr("href");
cnt = cnt + 1;
//alert($(this).attr("href"));
}
});
but I want the dropdown to be:
<select name="vehicle_make" onchange="test1(this.value)" style="width: 130px; float:left;" id="vehicle_make" class="home_input">
<option value="">Choose Make</option>
<option value="2063">Acura</option>
<option value="2064">Honda</option>
</select>
I want to have only the number before .htm in the above dropdownho send as value. Please inform.
source
share