function showHideMinMax(typeid ,value){
// extract the index number from typeid
var indexNr = typeid.match(/\d+/);
if(value == "blah"){
$("input#A"+indexNr).hide();
$("input#B"+indexNr).hide();
$("label[for=C"+indexNr+"]").hide();
$("label[for=D"+indexNr+"]").hide();
}else{
$("input#A"+indexNr).show();
$("input#B"+indexNr).show();
$("label[for=C"+indexNr+"]").show();
$("label[for=D"+indexNr+"]").show();
}
}
I have a javascript function like above. So what I want is that in the else part is that if the html elements mentioned above in the else part dosen’t exits then create them and append to the html portion inside the li element. How can I achieve this.?
The li element looks like this and the above elements are inside this html li element
<li class="css" id="demo"+somenumber ">
You would use
appendorappendTo, e.g.:Or:
Where
elementIdis the id of thelielement. You’d need to adjust for your specific html.