9. Implementing Rules (1) { "id": "rule102", "priority": 1, "appliesTo": ["http://localhost/example/"], "eventExpression":{ "type":"mouseover", "target"$X", }, "condition": [ "$X: HTMLImageElement( src=='index_files/34422.jpg‘ )" ], "actions":[ "resizeImage("$X",200,300) ] } function resizeImage(elem,width,height){ try{ elem.setAttribute("width",width); elem.setAttribute("height",height); }catch(e){ alert(e); } } Assuming the DOM contains the following: <img src="index_files/34422.jpg" width="72" height="96"> We can write the rule: When we hover with the mouse over this image element resize the image .