JQuery kullanarak href değeri almaya çalışıyorum:
<html>
<head>
<title>Jquery Test</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$("a").click(function(event) {
alert("As you can see, the link no longer took you to jquery.com");
var href = $('a').attr('href');
alert(href);
event.preventDefault();
});
});
</script>
</head>
<body>
<a href="http://jquery.com/">jQuery</a>
</body>
</html>
Ama işe yaramıyor. Neden?
Bize tam olarak neyin işe yaramadığını söylemek ister misiniz? uyarı boş muydu? 2 uyarı bile aldın mı? Herhangi bir js hatası var mı? Benim için çalışıyor ...
—
Ben Rowe
upss ..., özür dilerim. sorun açık önbellek
—
Adi Sembiring
Burada keman: jsfiddle.net/LijoCheeran/t1xs4wo7
—
LCJ