开发者

html label don't work in ajax

开发者 https://www.devze.com 2023-02-09 18:26 出处:网络
I\'m loading html page via Ajax. Here\'s the data: <input type=\"checkbox\" name=\"dis_net\" id=\"dis_开发者_C百科net\" value=\"1\" />

I'm loading html page via Ajax. Here's the data:

<input type="checkbox" name="dis_net" id="dis_开发者_C百科net" value="1" />
<label for="dis_net">Test</label>

But the Label does not work. There is a way to solution. When I click in the Label checkbox to not put a tick

If we write the other way, it works

<label for="dis_net">Test</label>
<input type="checkbox" name="dis_net" id="dis_net" value="1" />


Other way of labeling:

<label><input type="checkbox" name="myinput" />Test</label>

This way it alway works. I tested your HTML it worked me well, even by loading it with AJAX. What browser do you test it? Strange errors like this can be browser specific.

0

精彩评论

暂无评论...
验证码 换一张
取 消