Monday, June 3, 2024
 Popular · Latest · Hot · Upcoming
52
rated 0 times [  57] [ 5]  / answers: 1 / hits: 72854  / 14 Years ago, thu, november 4, 2010, 12:00:00

Well i have a asp.net page where i have a button that im using to execute a JavaScript... but after the JavaScript has run the page reloads(postback) how can i avoid that?



<button onclick=printElement('content');>Print</button>

More From » asp.net

 Answers
5

you need to use return false



<button onclick=printElement('content');return false>Print</button>

[#95079] Tuesday, November 2, 2010, 14 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
jocelyntrishar

Total Points: 48
Total Questions: 96
Total Answers: 83

Location: South Sudan
Member since Sun, Jul 11, 2021
3 Years ago
;