Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to use onclick with name attribute?
    primarykey
    data
    text
    <p>I have a multiple ul's (HTML lists) in my website and the structure of that ul's are as following:</p> <pre><code>&lt;ul id="today_match_'+ counter +'_'+ today_counter +'" name= "today_group_'+counter+'" class="contests"&gt;&lt;li id="'+page_url+'" class="fixture"&gt;&lt;table class="fixture_table" border="1"&gt;&lt;tr&gt;&lt;td class="checkbox"&gt;&lt;input type="checkbox" id="today_checkbox_'+ counter +'_'+ today_counter +'" class="checkbox"&gt;&lt;/td&gt;&lt;td id="today_status_'+ counter +'_'+ today_counter +'" class="status" name="today_link_'+ counter +'_'+ today_counter +'"&gt;'+ status1 +'&lt;/td&gt;&lt;td id="today_localteam_'+ counter +'_'+ today_counter +'" class="winner_localteam" name="today_link_'+ counter +'_'+ today_counter +'"&gt;'+ localteam +'&lt;/td&gt;&lt;td id="today_goalsLocalteam_'+ counter +'_'+ today_counter +'" class="goals_localteam" name="today_link_'+ counter +'_'+ today_counter +'"&gt;'+ goals_localteam +'&lt;/td&gt;&lt;td class="space" id = "'+static_id+'_'+ counter +'_'+ today_counter+'" name="today_link_'+ counter +'_'+ today_counter +'"&gt;-&lt;/td&gt;&lt;td id="today_goalsVisitorteam_'+ counter +'_'+ today_counter +'" class="goals_visitorteam" name="today_link_'+ counter +'_'+ today_counter +'"&gt;'+ goals_visitorteam +'&lt;/td&gt;&lt;td id="today_visitorteam_'+ counter +'_'+ today_counter +'" class="visitorteam" name="today_link_'+ counter +'_'+ today_counter +'"&gt;'+ visitorteam +'&lt;/td&gt;&lt;td id="today_htScore_'+ counter +'_'+ today_counter +'" class="ht_score" name="today_link_'+ counter +'_'+ today_counter +'"&gt;'+ ht_score +'&lt;/td&gt;&lt;td id="today_startTime_'+ counter +'_'+ today_counter +'" class="start_time" name="today_link_'+ counter +'_'+ today_counter +'"&gt;&lt;/td&gt;&lt;td id="today_iddaaCode_'+ counter +'_'+ today_counter +'" class="iddaa_code" name="today_link_'+ counter +'_'+ today_counter +'"&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/li&gt;&lt;/ul&gt; </code></pre> <p>all the values inside the td's are from an xml file and each ul have an id,class and name. If you notice I have a table inside the li of each ul and the first td of that table is a checkbox . Now, the problem is that each ul is a fixture in my live score website and when I click on that ul I should get a page of results, But when I link the Id of the table to onclick handler it interferences with the click of checkbox (I mean when i click on the checkbox the link is clicked and when I click on the link the checkbox is selected) I can not make inner table for all the td's excluding the checkbox (because of CSS reasons) So I tried to give the same name attribute for all the td's of the tables excluding the td of the checkbox and link them with onclick but it did not work. I want to know if there is any way that could be useful to used here? The onclick handler:</p> <pre><code>$("name[today_link_"+ counter +'_'+ today_counter+"]").click(function() { testwindow = window.open(page_url, "mywindow", "location=1,status=1,scrollbars=1,width=800,height="+screen.height+",resizable=1"); testwindow.moveTo(0, 0); }); </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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.
 

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