ITPub博客

首页 > 应用开发 > > onclick="clearinfo(this) 中的this代表什么意思

onclick="clearinfo(this) 中的this代表什么意思

作者:tzhang911 时间:2019-09-24 15:00:48 0 删除 编辑

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

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

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>无标题文档</title>

<script>

function changewebsize(){

    document.getElementById("webSite").innerHTML="<a href='http://163.com'>网易</a>";

    }

     function clearinfo(obj){

        

         obj.value="";

         obj.style.color="black";

         }

</script>

</head>

<body>

<div id="webSite"><a href="http://baidu.com">百度</a></div>

<input type="button" value="改变层内容"  onclick="changewebsize()" />

<br /><br />

<input type="text" name="city" value="请选择您工作的城市" onclick="clearinfo(this) " class="wordstext"/>&nbsp;&nbsp;&nbsp;&nbsp;

<input type="text"  name="city" value="请选择您工作的第二志愿城市" onclick="clearinfo(this)" class="wordstext" />

<br /><br />

<input type="text" name="city" value="请选择您工作的城市"  onclick="clearinfo(this) " class="wordstext"/>&nbsp;&nbsp;&nbsp;&nbsp;

<input type="text"  name="city" value="请选择您工作的第二志愿城市"  onclick="clearinfo(this) " class="wordstext" />

<br /><br />

<input type="text" value="显示上面的input所有内容"   onclick="clearinfo(this) " class="wordstext" />&nbsp;&nbsp;&nbsp;&nbsp;

<input type="text" value="显示所有城市所有内容" onclick="clearinfo(this) " class="wordstext"/>&nbsp;&nbsp;&nbsp;&nbsp;

</body>

</html>

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/1926/viewspace-3128612/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-04-16

  • 博文量
    100
  • 访问量
    751