Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I looked at it a little more closely and am editing this answer.</p> <p>It appears that the button function needs a label with a special attribute called "for" with a value that is the same as the id of the input element which will become the button.</p> <p>In the below example, I observed that the label/input relationship in your sample output was different from this Label.</p> <p>The below example is based on the documentation found at: <a href="http://docs.jquery.com/UI/Button" rel="nofollow">http://docs.jquery.com/UI/Button</a></p> <pre><code>&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js"&gt;&lt;/script&gt; &lt;script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js"&gt;&lt;/script&gt; &lt;script&gt; $(document).ready(function() { $(".Activechk").button(); }); &lt;/script&gt; &lt;/head&gt; &lt;div id="problem"&gt; &lt;label&gt;&lt;input type="checkbox" checked="checked" class="Activechk form-contractor-active" /&gt;Active One&lt;/label&gt; &lt;br /&gt; &lt;label&gt;&lt;input type="checkbox" checked="checked" class="Activechk form-contractor-active" /&gt;Active Two&lt;/label&gt; &lt;br /&gt; &lt;label&gt;&lt;input type="checkbox" checked="checked" class="Activechk form-contractor-active" /&gt;Active Three&lt;/label&gt; &lt;/div&gt; &lt;hr /&gt; &lt;div id="solution"&gt; &lt;p&gt;Inputs can be somewhere else on the DOM but cannot be child elements of labels. The buttons appear where the labels are:&lt;/p&gt; &lt;!-- input elements --&gt; &lt;input id="inputSolutionOne" type="checkbox" checked="checked" class="Activechk form-contractor-active" /&gt; &lt;input id="inputSolutionTwo" type="checkbox" checked="checked" class="Activechk form-contractor-active" /&gt; &lt;input id="inputSolutionThree" type="checkbox" checked="checked" class="Activechk form-contractor-active" /&gt; &lt;!-- label elements --&gt; &lt;table&gt; &lt;tr&gt;&lt;td&gt; &lt;label for="inputSolutionOne"&gt;Active One&lt;/label&gt; &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt; &lt;label for="inputSolutionTwo"&gt;Active Two&lt;/label&gt; &lt;/td&gt;&lt;/tr&gt;&lt;tr&gt;&lt;td&gt; &lt;label for="inputSolutionThree"&gt;Active Three&lt;/label&gt; &lt;/td&gt;&lt;/tr&gt; &lt;/table&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload