meysamamarlou
August 15th, 2018, 15:25
سلام چجوری میتونم با کلاس لینک بدم؟
<!DOCTYPE html>
<html>
<body>
<p><a class="myAnchor">test</a></p>
<script>
var x = document.getElementByClassName("myAnchor");
x[0].href = "http://www.test.com/";
</script>
</body>
</html>
اینو میزنم نمیشه قالب صفحه یک عکسی هست فقط کلاس داره آی دی نداره میخوام بهش لینک بدم
<!DOCTYPE html>
<html>
<body>
<p><a class="myAnchor">test</a></p>
<script>
var x = document.getElementByClassName("myAnchor");
x[0].href = "http://www.test.com/";
</script>
</body>
</html>
اینو میزنم نمیشه قالب صفحه یک عکسی هست فقط کلاس داره آی دی نداره میخوام بهش لینک بدم