Note that there are some explanatory texts on larger screens.

plurals
  1. POHow would I set focus on an after I remove its sibling in javascripts
    primarykey
    data
    text
    <p>I have the following code: </p> <pre><code>remove: function(child, obj){ for (var i = 0, len = obj.compareComponents.length; i &lt; len; i++) { if (obj.compareComponents[i] == child) { obj.compareComponents.splice(i, 1); break; } } dojo.forEach(obj.checks, function(arr){ if (arr.number == child.id) { obj.states.checkMarks.empty(arr, obj, child); } }); obj.properties.numberTaken--; obj.states.compare.checksFull.value.isTrue = false; obj.states.compare.checksFull.settings(obj); if (obj.properties.numberTaken &lt; 2) { obj.states.compare.noChecks(obj); } } </code></pre> <p>What I am trying to as the checkboxes are unchecked and removed I want the focus to be set on the element to the right of it. What logic do I add to accomplish this?</p> <p>Focus will set automatically if I can set the tab index of the first checkbox to 0 here is the code that was written creating the check boxes how would I modify it to set the first element's tab index to 0? </p> <pre><code>var image = arr.image[0].src; image = '&lt;th id="cell4' + arr.id + '" scope="col"&gt;&lt;span class="pcChecks"&gt;&lt;input checked="checked" type="checkbox" name="pc' + arr.id + '" id="pc' + arr.id + '" class="compare" /&gt;&lt;label for="pc' + arr.id + '" id="" class="compare"&gt;' + '&lt;span class="hide-fromsighted"&gt;Remove ' + temptitle + '&lt;/span&gt;' + 'Remove&lt;/label&gt;&lt;/span&gt;&lt;div&gt;&lt;a href="/shop/product-detail.jsp?id=' + arr.id + '&amp;prodName=' + temptitle + '""&gt;&lt;img height="106" alt="' + temptitle + '"src="' + image + '"/&gt;&lt;/a&gt;&lt;/div&gt;&lt;/th&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. 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