Note that there are some explanatory texts on larger screens.

plurals
  1. POhow to make array groups using jquery or javascript
    primarykey
    data
    text
    <p>This is the code to make arrays and access them.</p> <pre><code>&lt;script&gt; $(document).ready( function() { var i; var mycars = new Array(); mycars[0] = "Car1"; mycars[1] = "Car2"; mycars[2] = "Car3"; mycars[3] = "Car4"; var Car1 = { ownerName: "Owner1", phoneNumber: "phoneNumber1", address: "Address1" } var Car2 = { ownerName: "Owner2", phoneNumber: "phoneNumber2", address: "Address2" } var Car3 = { ownerName: "Owner3", phoneNumber: "phoneNumber3", address: "Address3" } $("div#tabbable").tabs(); // $("button#add-tab").click(function() { var num_tabs = $("div#tabbable ul li").length + 1; for (i = 0; i &lt; mycars.length; i++) { $("div#tabbable ul").append( "&lt;li&gt;&lt;a href='#tab" + num_tabs + "'&gt;" + mycars[i] + "&lt;/a&gt;&lt;/li&gt;"); $("div#tabbable").append( "&lt;div id='tab" + num_tabs + "'&gt;#" + mycars[i] + "&lt;/div&gt;" ); $("div#tabbable").tabs("refresh"); } //}); }); &lt;/script&gt; &lt;body&gt; &lt;!-- needed for tabbable population --&gt; &lt;div class="row-fluid"&gt; &lt;div class="span5 offset1"&gt; &lt;div id='tabbable'&gt; &lt;ul class="nav nav-tabs nav-stacked"&gt; &lt;li&gt; &lt;!-- &lt;a href='#tab1'&gt;#1&lt;/a&gt; --&gt;&lt;/li&gt; &lt;/ul&gt; &lt;!-- &lt;div id='tab1'&gt;&lt;/div&gt; --&gt; &lt;/div&gt; &lt;!-- &lt;button id='add-tab'&gt;Add tab&lt;/button&gt; --&gt; &lt;/div&gt; &lt;/div&gt; &lt;!-- end --&gt; &lt;/body&gt; </code></pre> <p>What if I need the details of each car, like how do I make an array whicj is dependent on the mycars array. when I am populating the car details using objects how do I get the details of car in this code? How do I get these car details when clicked on the populated tabs???</p>
    singulars
    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