javascript - Add Item to Table - HTML/CSS/JS -


Suppose i have a dropdown (or congbox) and there is a list of things once i get one thing from the list , Then it will automatically add to the table. How would I do that? Is it possible only HTML / JS?

Dropdown:

  & lt; Select class = "Cambodia form-control" style = "display: none;" & Gt; & Lt; Option value = "" selected = "selected" & gt; Point guard & lt; / Option & gt; & Lt; Option value = "cp3" & gt; Chris Paul (93) & lt; / Options & gt; & Lt; / Select & gt;  

Table:

  & lt; Table class = "table" & gt; & Lt; Thead & gt; & Lt; TR & gt; & Lt; Th & gt; Status & lt; / Th & gt; & Lt; Th & gt; First name & lt; / Th & gt; & Lt; Th & gt; Last name & lt; / Th & gt; & Lt; / TR & gt; & Lt; / Thead & gt; & Lt; Tbody & gt; & Lt; TR & gt; & Lt; TD & gt; 1 & lt; / TD & gt; & Lt; TD & gt; Mark & ​​lt; / TD & gt; & Lt; TD & gt; Otto & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; 2 & lt; / TD & gt; & Lt; TD & gt; Yakub & lt; / TD & gt; & Lt; TD & gt; Thornton & lt; / TD & gt; & Lt; / TR & gt; & Lt; TR & gt; & Lt; TD & gt; 3 & lt; / TD & gt; & Lt; TD & gt; Larry & lt; / TD & gt; & Lt; Td> Bird & lt; / Td> & Lt; / TR & gt; & Lt; / Tbody & gt; & Lt; / Table & gt;  

Thanks.

jQuery usage:

<(> 'combobox') .changes (function ) {Var selectedVal = $ (this) .val (); $ ('table.') .andand ('<'> & lt; td> '+ Selected Val +' & lt; / td & Gt; & lt; / tr & gt; ';)});

I hope you will get this idea.


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -