I'm having problems making style alterations to the DOM after I submit a form in Safari. Does anyone have any idea if its even possible? Is this expected browser behavior from Safari?
I have set up a very simple example so you can see the issue in action: http://jamesmichaelking.com/stackoverflow/safari/index.html
The example consists of a html form posting to itself, with a jquery form submit event which looks for the input button and changes the background to red.
The example works fine in Firefox and Chrome
I've included the html, js and css from the example:
HTML
<form action="index.html" method="post">
<input type="submit" value="Submit me!">
</form>
CSS
body {
font-family: sans-serif;
color: #fff;
text-align: center;
}
input {
border: none;
padding: 20px;
font-size: 20px;
background: #036;
color: #fff;
}
JQUERY
$(function() {
$('form').on('submit', function() {
$(this).find('input').css('background', '#c00');
});
});
Strangely, I have created a JSFiddle of the same code and it works fine: http://jsfiddle.net/jamesking/q8WcV/
I'm testing using Safari 7 on a mac
Any help much appreciated