Note that there are some explanatory texts on larger screens.

plurals
  1. PO$('.add').live('click', function()
    primarykey
    data
    text
    <p>i can't seem to be able to put option tag in my javascript. do help me sifu.<br> what i'm trying to do there is the function for the add button.</p> <pre><code> var scntDiv = $('.input'); var i = $('.input p').size() + 0; $('.add').on('click', function() { $('&lt;p&gt;&lt;input type="text" name="barcode' + i + '" id="textbox_input1" placeholder="Barcode"/&gt; &lt;input type="text" name="item' +i+ '" id="textbox_input1" placeholder="Item"/&gt; &lt;input type="number" name="qtty' +i+ '" id="textbox_input1" placeholder="Quantity"/&gt; &lt;input type="number" name="min' +i+ '" id="textbox_input1" placeholder="Minimum"/&gt; &lt;select name="category' +i+ '" id="textbox_input1"/&gt;&lt;option value="Grocery"&gt;Grocery&lt;/option&gt;&lt;option value="Furniture"&gt;Furniture&lt;/option&gt;&lt;/select&gt; &lt;input type="text" name="price' +i+ '" id="textbox_input1" placeholder="Price"/&gt; &lt;input type="text" name="promo' +i+ '" id="textbox_input1" placeholder="Promo"/&gt; &lt;button type="button" class="remove" id="button"&gt;Remove&lt;/button&gt;&lt;/p&gt;').appendTo(scntDiv); i++; return false; }); </code></pre> <p>please help me. my problem is the option value does not appear when the add button is clicked. this </p> <pre><code>&lt;select name="category' +i+ '" id="textbox_input1"/&gt;&lt;option value="Grocery"&gt;Grocery&lt;/option&gt;&lt;option value="Furniture"&gt;Furniture&lt;/option&gt;&lt;/select&gt; </code></pre> <p>does not give out any option in the script.</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.
 

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