I'm having the following code. From this I want to display the value one two three each in new line.
<p><select id="temp">
<option value="default" selected="selected">--Choose value--</option>
<option >one</option>
<option >two</option>
<option >three</option>
</select>
</p>
im trying to remove all the tags and putting new line between each value and remove --Choose value-- text
i want ouput as - > one two three(each in new line)
here is what I've tried
tmp = tmp.replace(/<\/p><p>/ig, "<\/p>\n<\/p>");
tmp = tmp.replace(/(<([^>]+)>)/ig,"");
tmp = tmp.replace(/\n/g, "\n");
tmp = tmp.replace("--Choose an option--","");
/ig, "<\/p>\n<\/p>"); tmp = tmp.replace(/(<([^>]+)>)/ig,""); tmp = tmp.replace(/\n/g, "\n"); tmp = tmp.replace("--Choose an option--","");
– kiran Apr 26 '11 at 12:32/ig, "<\/p>\n<\/p>"); tmp = tmp.replace(/(<([^>]+)>)/ig,""); tmp = tmp.replace(/\n/g, "\n"); tmp = tmp.replace("--Choose an option--","");
– kiran Apr 26 '11 at 12:36