new Ajax.Request(url,
{
parameters: {opt_product_id: 22},
onSuccess: function(response) {
// Handle the response content...
if (response.responseText === "1") {
$("showoutofstocknotifbox").show();
alert('it works'); //ajax response successful alert box shows
$$('.product-options-bottom')[0].hide(); //should hide a div element
} else {
$("showoutofstocknotifbox").hide();
}
},
});
$$('.class') is used to return array, so need to mention index with ...