This is my js code:
function myfunction(){
$("#label_startDate[0]")[0].outerHTML;
}
and this is the html part:
<label id="label_startDate[0]" class="" style="">
<span id="star_startDate[0]" style="display: none; color: red">*</span>
<input name="startDate[0]" id="startDate[0]" value="2015-06-02" readonly="" class="forDatePicker hasDatepicker" size="14" onchange="changeEndDate(0); calculateDaysDuration('@[0]', 0); "type="text">
</label>
For the reason that I have a weird format of the id from the label, I cannot get the outerHTML. What should I do ? I cannot change the id label_starDate[0].
document.getElementById(...)instead. That's effectively what you're using anyway (and it will be hugely faster than the $ selector).