There are two types of Button. One is Submit Button and another is Normal Button.
You have used Submit Button as you have specified
type="submit"
. And the behaviour of Submit Button is to GET/POST data (submit data) to server side if you have used inside the form tags.
As you are saying it is flashing, it is actually posts back and tries to send data of the page to the specified page in action attribute of form tag.
Refer -
HTML form Tag[
^].
In the example given in W3Schools, it is posting data to
demo_form.asp
page as it is mentioned inside the action attribute of form tag.
So, to avoid this, just use Normal Button, your issue will be resolved. Like below...
<input type="button" value="post" önclick="postf();"></input>