#9753 closed bug (invalid)
Setting option value (containing space) using append
Reported by: | madhurs99 | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | manipulation | Version: | 1.4.4 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Appending new option using below code
var OptionDesc = "United Kingdom"; var OptionValue = "United Kingdom" $('select').append("<Option value="+OptionValue+" >"+OptionDesc+"</Option>");
generates wrong HTML
<select> <option value="United" kingdom="">United Kingdom</option> </select>
Change History (3)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
The value
attribute needs to be quoted if it contains spaces.
comment:3 Changed 12 years ago by
Component: | unfiled → manipulation |
---|---|
Priority: | undecided → low |
Note: See
TracTickets for help on using
tickets.
Please find below the test case for the same
http://jsfiddle.net/madhurs99/y8Mbw/