Content changes dynamically using javascript but effects does not remain permanant
When I use javascript to change font/color/size or inner html, it works temporarily only. Changes does not remain permanent. e.g.
<title>Showing Charset</title>
Charset
<form name="seefont"> <input type="text" id="myfont" name="fonttosee" size="20" value="arial"> <button onclick="chngFont()">Change font</button> </form>
When I click the button class head_class is applied to heading id "head" and even the text is change to font name entered but just momentarily. If I use alert in the function, the changes remain only till alert is on the screen.
The same code works in IE forever ( The changes remain permanent.
What are the settings in firefox to make the changes using javascript permanent ?
mahesh_chavan کی جانب سے
تمام جوابات (2)
منتخب شدہ حل
Your <button> might be submitting the form and causing the page to refresh. Try this to prevent form submission:
<button onclick="chngFont(); return false;">
Thank you so much jscher2000 ! Firefox reloads the page automatically and that was the problem. Now the changes remains permanent
mahesh_chavan کی جانب سے