creating href link within select option tag withou

2019-08-03 12:43发布

问题:

I have dropdown and onchange of that dropdown I'm doing some ajax call and updating the table contens like this,

Main_page.php

<select>
    <option>go to one</option>
    <option>go to two</option>
    <option>go to three</option>
    <option>go to four</option>
</select>
<table>
    on change of dropdown will update this contents
</table>

also I have seprate link's like,

http://example.com/Main_page.php/go-to-one

http://example.com/Main_page.php/go-to-two like this

now I want to give these http links to dropdown for SEO purpose and my problem is

<select>
    <option>
        <a href='http://example.com/pages.php/go-to-one'>go to one</a>
    </option>
</select>

This is not working (means <a> tag is not showing in the browser)

Here I can't put href by using javascript or jquery because I am doing this for SEO. Only possibility is I want to put using HTML only.

Can anyone help me to solve this?

Thank you in advance.

回答1:

Try this. It worked for me.

<select>
    <option value='http://example.com/pages.php/go-to-one'>go to one</option>
</select>


标签: html html5 seo