Note that there are some explanatory texts on larger screens.

plurals
  1. POAm using Push() array was used am trying to use for select a list from drop down menu and post that list into a span?
    primarykey
    data
    text
    <h3>HTML section</h3> <p>div to show the values</p> <pre><code> &lt;div class="lef rightCol n"&gt; &lt;span class="para"&gt; add-on Services(Optional)&lt;/span&gt; &lt;div class="new"&gt; &lt;ul&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div </code></pre> <p>div that contain drop down</p> <pre><code> &lt;div class="rightCol n mar "&gt; &lt;span id="at1" class="spn"&gt;Click here to add add-on Services&lt;/span&gt; &lt;ul id="ad1" class="drpdwn"&gt; &lt;li&gt;&lt;input type="checkbox" id="ck1" value="1"&gt;&lt;a id="a1"&gt;Drop Shadows&lt;/a&gt;&lt;/ li&gt; &lt;li&gt;&lt;input type="checkbox" id="ck2" value="2"&gt;&lt;a id="a2"&gt;Reflections&lt;/a&gt; &lt; li&gt; &lt;li&gt;&lt;input type="checkbox" id="ck3" value="6"&gt;General Spotting&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>I have tried this slide down while click</p> <h3>jQuery</h3> <p>slide down while click at1(Span)</p> <p>this is the try for show on span on new div</p> <p>here where should i use Push() most of them force me to use i don't know how and for what</p> <pre><code> var ots = []; $('#at1,#at2,#at3,#at4,#at5,#at6').click(function(){ $(this).next('.drpdwn').stop().slideToggle(); }), $('#ck1').click(function() { option=$('#a1').text(); $('.new ul').append('&lt;li&gt;&lt;span id="span1" alt="1" &gt;&lt;/span&gt;&lt;/li&gt;'); $('#span1').html(option).addClass('surr'); ots.push({id: 1}); }), $('#ck2').click(function() { option=$('#a2').text(); $('.new ul').append('&lt;li&gt;&lt;span id="span2" alt="1" &gt;&lt;/span&gt;&lt;/li&gt;'); $('#span1').html(option).addClass('surr'); ots.push({id: 2}); }), </code></pre> <p>now i moved some value to array ots while append now the question is how to retrieve the newly created span's alt atrribute using array..?am using like these its not working clearly</p> <p>some function</p> <pre><code> var f = $('.new span').length; ad=o; cs=o; for(i=1;i&lt;=f;i++) { $.each(this.opt, function() { $.each(this, function(name, value) { cs=eval($( "#span"+value).attr("alt")); console.log(name + '=' + value); ad+=cs; console.log("ad: "+ad); }) }) } </code></pre> <p>it shows ad as Nan and every time i click those id's it created like 1 then 1,2 then 1,2,3 like this help me out every time select check box it plays like this.! </p>
    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.
 

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