How do I add rel="nofollow" target="_blank" to drop down list? It doesn't work in the normal html way. <form name="htmlMenu3"> <select name="list" class=width> <option value="www.google.com">Google<option> </select> <input type="button" onClick="document.location = document.htmlMenu3.list.options [document.htmlMenu3.list.selectedIndex].value;"value="GO"> </form> Code (markup):
You can't add rel=nofollow to an option value, and there's little point in doing so. Search engines won't treat those option values as links, and they won't follow them anyway.
itcn is right about the nofollow. I don't think you can add a target attribute to a drop-down list either. You can simulate it by changing the javascript you're triggering on the button click though. Instead of document.location, use window.open. I haven't tested this, but it should probably look something like onclick="window.open(document.htmlMenu3.list.options[document.htmlMenu3.list.selectedIndex].value, 'newWin')"
Thanks for the replies. The links show in the html source, but they don't have a href which I'm guessing stops the search engines following them. I tired that open window javascript but I couldn't get it to work. I edited it a bit to follow the same look of the other one, but it still doesn't work. <input type="button" onclick="window.open = document.htmlMenu2.list.options[document.htmlMenu2.list.selectedIndex].value;"value="Go">
Hmmm. Sorry, but I don't know what's wrong. I tried out my original suggestion and it works okay for me. Hopefully someone else will be able to help out here.
Ok, I have got it working now except for displaying the "go" at the end or newWin as you put. Can you help with that? thanks