Question:

What is the correct syntax for using the xHtml "select" tag.

by  |  earlier

0 LIKES UnLike

Specifically, if there are 3 options but I want the third option to be highlighted by default.

 Tags:

   Report

3 ANSWERS


  1. Try the following for a radio button:

    <?xml version="1.0" encoding="UTF-8"?>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-...

    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

    <head>

    <title>DevGuru XHTML input Tag Example</title>

    </head>

    <body>

    <form>

    <input type="radio" name="radio1" value="one" />

    <input type="radio" name="radio1" value="two" />

    <input type="radio" name="radio1" value="three" checked="checked" />

    </form>

    </body>

    </html>


  2. <select name="my_options">

       <option value="1">One</option>

       <option value="2">Two</option>

       <option value="3" selected="selected">Three</option>

    </select>

  3. I am writing the example code please see it and try to implement

    <select multiple>

      <option>XHTML MP Tutorial Part 1</option>

      <option selected>XHTML MP Tutorial Part 2</option>

      <option>XHTML MP Tutorial Part 3</option>

    </select>

Question Stats

Latest activity: earlier.
This question has 3 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.