Last active
August 9, 2020 08:14
-
-
Save znake/4524458 to your computer and use it in GitHub Desktop.
link table row with jquery
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> | |
<title>Full Row Select Using jQuery</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script> | |
<style type="text/css"> | |
.Pointer { | |
cursor: pointer; | |
} | |
</style> | |
</head> | |
<body> | |
<table width="100%" border="1" cellpadding="0" cellspacing="0" class="Pointer"> | |
<tr url="http://www.google.at"> | |
<td>1</td> | |
<td>2</td> | |
<td>3</td> | |
</tr> | |
<tr url="http://www.yahoo.at"> | |
<td>4</td> | |
<td>5</td> | |
<td>6</td> | |
</tr> | |
<tr url="http://www.bing.at"> | |
<td>7</td> | |
<td>8</td> | |
<td>9</td> | |
</tr> | |
</table> | |
<script type="text/javascript"> | |
$(function () { | |
$("table tr").live("click",function() { | |
location.href = $(this).attr("url"); | |
}); | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
its not work!