Zhasulan Berdibekov
Zhasulan Berdibekov

Reputation: 1087

html label don't work in ajax

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

<input type="checkbox" name="dis_net" id="dis_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" />

Upvotes: 2

Views: 987

Answers (1)

&#193;kos Nikh&#225;zy
&#193;kos Nikh&#225;zy

Reputation: 1306

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.

Upvotes: 5

Related Questions