Mr. Pink
پنج شنبه 02 بهمن 1393, 22:07 عصر
سلام دوستان
یه کدی نوشتم که وقتی روی دکمه کلیک کنی متن داخل h1 عوض بشه نمیدونم مشکلش چیه اگه میشه راهنمایی کنید.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>XO</title>
<script>
window.onload = function () {
function abc() {
var hd = document.getElementById('hd');
hd.innerText = "qwer";
};
};
</script>
</head>
<body>
<h1 id="hd">Hello!!!</h1>
<input type="button" value="Click" id="b1" onclick="abc();" />
</body>
</html>
یه کدی نوشتم که وقتی روی دکمه کلیک کنی متن داخل h1 عوض بشه نمیدونم مشکلش چیه اگه میشه راهنمایی کنید.
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>XO</title>
<script>
window.onload = function () {
function abc() {
var hd = document.getElementById('hd');
hd.innerText = "qwer";
};
};
</script>
</head>
<body>
<h1 id="hd">Hello!!!</h1>
<input type="button" value="Click" id="b1" onclick="abc();" />
</body>
</html>