because the HTML is a string - like others have mentioned try adding it to a container div and then getting the elements you want out of it. FYI the select()
will return an array of elements that match the selector so if you only want the specific <div>
use the down()
method which will return the first one.
var myAjax = new Ajax.Request(
url,
{
method: 'post',
onException: function (xhr, e)
{
alert('Exception : ' + e);
},
onComplete: function (xhr)
{
var myHtml = xhr.responseText;
// alert(myHtml);
var myContent = new Element('div').update(myHtml);
myContent = myContent.down("div#product-options-wrapper");
alert(myContent);
}
});