0

I have one select tag

I want to change select tag value from value="-1:Select;" to value="-1:Select;2:option1"

<select role="select" value="-1:Select;" id="brandingName" name="brandingName" size="1" class="FormElement">
</select>

value="-1:Select;"

I have tried with below syntax but it does not change:

document.getElementById("brandingName").value = "-1:Select;2:option1";

How can I change this value using JavaScript or jQuery?

Sébastien
  • 11,860
  • 11
  • 58
  • 78
Shiladittya Chakraborty
  • 4,270
  • 8
  • 45
  • 94

1 Answers1

3

You need to select the id and use attr to change value, like this with out having testing it.

$("#brandingName").attr("value", "-1:Select;2:option1")
Maytham Fahmi
  • 31,138
  • 14
  • 118
  • 137