javascript - Cant' put number in value of text input using jquery -


I have a list that has many options, I dynamically set an event whenever a button is clicked , Create tables and text inputs and put values ​​in the list, but I have an option in which there is a number value but not set to the value of that input, see my code.

My jquery code:

  $ ("# table_drugs"). Annexe ("& lt; tr> " + $ ("#Val (+) +" & gt; "+" & lt; / td & gt; & lt ("Explain #Drugs "). $ (" Explanation of # drugs "). Val () +" input type = 'text' name = 'how_to_use' value = "+ $ (" # drugs-explain "). Val () + "& Gt; +" & lt; / td & gt; & lt; td & gt; "+" & gt; Button type = 'button' class = 'call-sm-7btn btn-danger pull-right' & '   

and my html: P>

  

You need to quote around your values: < Pre> $ ("# tables_drugs"). ("& Lt; tr & gt; & lt; td & gt;" + $ ("# drugs_list"). Val () + "& lt; input type = 'text' name = 'past_druges_used' value =" "+ $ ("#Drugs_list"). Val () + "'" gt "" & lt; td & gt; "+ $ (" Explain # drugs "). Val () +" & Lt "+" & lt; / td> & lt; td & gt; "+" input type = 'text' name = 'how_to_use' value = '"+ $ (" #drugs-explanation "). () + "'& Gt; Button type =' button 'class =' ​​colon-sm-7btn btn-danger moment-right '' gt; delete & lt; / button & gt;" + "& lt ; / Td> & lt; / tr & gt;);

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -