How can I let something happen a certain percentage of the time? (Javascript) : <p>I'm a noob at javascript, sorry if this is a dumb question.
I want something to happen a certain % of the time.</p>

<p>So if a user clicks a button, x% of the time situation A will happen (Let's call this succes) and the other times situation B will happen.</p>

<p>The thing is, that the more user succeeds, the more % chance the user should have of succeeding the next time.</p>

<p>Any ideas?</p>
