Can anyone check and advice if my code is standard for mobile device? I can't seem to make it work on iPhone and my android. This works well on my desktop but not on mobile devices. I'm trying to create a toggling checkbox, that when a user check the checkbox it will show the button, if it's uncheck it will show the disabled version ('#disableBtn')
Javascript + Jquery
$(function()
{
$('#agreed').change(function()
{
if ($(this).attr("checked"))
{
$('#disableBtn').hide();
$('#button').css('display', 'block');
return;
}
$('#disableBtn').show();
$('#button').css('display', 'none')
});
})
HTML
<input id="agreed" type="checkbox" name="check" value="1">
<a id="button" href="#>">Button</a>
<span id="disableBtn">Disabled</span>
CSS
#button { display: none }