Skip to content

Instantly share code, notes, and snippets.

@sabril
Created November 8, 2018 02:55
Show Gist options
  • Save sabril/657c0ffe2fbcefa3d2b6394c621656f0 to your computer and use it in GitHub Desktop.
Save sabril/657c0ffe2fbcefa3d2b6394c621656f0 to your computer and use it in GitHub Desktop.
Javascript test for sureswift capital
function checkSoldOut() {
if ($('#SingleOptionSelector-0').val() == 'Large') {
$( "<div id='email_when_available' style='padding: 0 5px;'><button style='color: #fff; background-color: #900; width: 100%; '>EMAIL WHEN AVAILABLE</button></div>" ).insertAfter( ".product-form" )
} else {
$('#email_when_available').remove()
}
}
$('#SingleOptionSelector-0').on('change', function() {
checkSoldOut()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment