Home >Web Front-end >HTML Tutorial >Problem with title attribute of tag in html

Problem with title attribute of tag in html

黄舟
黄舟Original
2017-07-03 10:10:554867browse

The title attribute of5a07473c87748fb1bf73f23d45547ab84afa15d3069109ac30911f04c56f3338 tag in htmlProblem

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">  
<HTML>  
 <HEAD>  
  <TITLE> New Document </TITLE>  
  <script>  
  //由于<option></option>标签的title属性在有些浏览器上不能够正常工作,  
  //因此我们找了一个解决方法(在<select></select>标签上做文章,具体方法如下:)  
  </script>  
 </HEAD>  
 <BODY>  
<select id=&#39;yy&#39; name=mysel onchange="document.getElementById(&#39;yy&#39;).title=this.options[this.selectedIndex].text;">   
<option value=title1 title=&#39;1&#39;>new1 </option>  
<option value=title2 title=&#39;2&#39;>new2 </option>  
<option value=title3 title=&#39;3&#39;>new3 </option>  
<option value=title4 title=&#39;4&#39;>new4 </option>  
</select>  
 </BODY>  
</HTML>

The above is the detailed content of Problem with title attribute of tag in html. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn