I want to remove a list of dom events attribute from html? how to do this? like:
before = "<div onclick="abc" >abc</div>"
after = clean_it(before) // after => "<div>abc</div>"
DOM_EVENT_TO_BE_REMOVE = "onclick|ondblclick|onerror|onfocus|onkeydown" // i want to remove these events
// i want to do it like this
def clean_it(html)
doc = Hpricot(html)
doc.search(DOM_EVENT_TO_BE_REMOVE).remove_attribute(DOM_EVENT_TO_BE_REMOVE)
doc.to_s
end
thanks.