This is a kind of similar duplicate to some others here, but I think I\'m using event.preventDefault() correctly in this case.
event.preventDefault()
Here\'s a JSFiddle you ca
Because your not passing the event object like function(event), but my question is why even go through all this when you can make the type="button" and onclick pass the values? In essence that what your doing with this whole process.
function(event)
type="button"