Side navigation
#9753 closed bug (invalid)
Opened July 06, 2011 05:33AM UTC
Closed July 06, 2011 12:42PM UTC
Last modified March 14, 2012 04:34AM UTC
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>
Attachments (0)
Change History (3)
Changed July 06, 2011 05:56AM UTC by comment:1
Changed July 06, 2011 12:42PM UTC by comment:2
resolution: | → invalid |
---|---|
status: | new → closed |
The value
attribute needs to be quoted if it contains spaces.
Changed July 06, 2011 01:13PM UTC by comment:3
component: | unfiled → manipulation |
---|---|
priority: | undecided → low |
Please find below the test case for the same
http://jsfiddle.net/madhurs99/y8Mbw/