【发布时间】:2020-06-22 00:10:48
【问题描述】:
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Untitled Document</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){var mainVal = $("#h1").valueOf();alert(mainVal);})</script>
</head>
<body>
<h1 id="h1" value="0">hallow you </h1>
</body>
</html>
我在这里尝试使用 val() 方法。任何帮助都是极好的。谢谢。
【问题讨论】:
标签: javascript jquery getvalue