Reputation: 5005
I have an onclick
onclick=\"showOrderParcelsResultsTable();\"
but in html is there a way to give some kind of default view
beacause i need it too show
showParcelResultsTable();
by default, can i do default=\"showParcelResultsTable();\" ?? but keeping the onclick at the same time
Upvotes: 0
Views: 97
Reputation: 7031
onClick happens only when you click on the div. If what you want is to call showOrderParcelsResultsTable() at first before any action, you should implement in javascript
window.onload = function(){
showParcelResultsTable();
};
(if this function is specific to one item you can use document.getElementById(divId) and pass it as a parameter to this function, or if you're using jquery
$('#divId or .divClass').each(function(){
showParcelResultsTable();
};) )
Upvotes: 2
Reputation: 23260
Put showParcelResultsTable();
in Script tags. Either after the page element or at the top in a ready block.
At the bottom of the page:
...
<script type="text/javascript">
showParcelResultsTable();
</script>
</html>
At the top:
<script type="text/javascript">
window.onload = function(){
showParcelResultsTable();
};
</script>
Upvotes: 1