Skip to content

Instantly share code, notes, and snippets.

@znake
Last active August 9, 2020 08:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save znake/4524458 to your computer and use it in GitHub Desktop.
Save znake/4524458 to your computer and use it in GitHub Desktop.
link table row with jquery
<!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>
@muhammadabir64
Copy link

its not work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment