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

Problem with title attribute of tag in html

黄舟
Release: 2017-07-03 10:10:55
Original
4870 people have browsed it

The title attribute of 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>
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template