Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
312 views
in Technique[技术] by (71.8m points)

javascript - Check string in select option

I have created with javascript and I get a result of a string.I get that result on my html code

<div id="results"></div>

Next,I want when I select for example Red to check if it is the the same thing (string), the select option - > Red with the string of this code

<div id="results"></div>

I was trying to do it but I failed.It is not working not even sure ,if I press the submit button I will send the string.

<div id="results"></div>
<form method="post" >

  <select >
    <option value="">--Please choose an option--</option>
    <option value="R">Red</option>
    <option value="B">Black</option>
  </select>
  
<input id="results" type="submit" value="results"/>

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to answer this question.

Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...