I have a javascript function..
<script type="text/javascript">
var RowClick = function() {
$("#mytable").click(
$("#showgrid").load('/Products/List/Items/'));
};
</script>
Can I call this function on onclick event on tr? I am calling something like this?
<tr class="something" onclick="javascript:RowClick()');">
can i call like this? if I call its not loading the URL?
can anybody help me out?
thanks
The javascript function that adds on click event on each row in the table. The function takes the table id as the parameter and return a callback with the row object on each row when it is clicked. function onRowClick(tableId, callback) { var table = document.getElementById(tableId),
The html table. The javascript function that adds on click event on each row in the table. The function takes the table id as the parameter and return a callback with the row object on each row when it is clicked. document.getElementById ('click-response').innerHTML = value + " clicked!";
How to Call Function on Button Click in JavaScript? There are two methods to call a function on button click in JavaScript. They are Get the reference to the button. For example, using getElementById () method.
The function takes the table id as the parameter and return a callback with the row object on each row when it is clicked. document.getElementById ('click-response').innerHTML = value + " clicked!";
There is no need to call RowClick()
inline. Just put that code into a click event handler and attach it to each row:
$(document).ready(function() {
$("#mytable tr.something").click(function() {
$("#showgrid").load('/Products/List/Items/'));
});
});
<tr class="something">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With