Here is my code
pattern.setAttribute('id','test');
pattern.setAttribute('patternUnits', 'userSpaceOnUse');
pattern.setAttribute('width','10');
pattern.setAttribute('height','10');
in same code i have used like this,
pattern.attr('id','test','id','test','patternUnits','userSpaceOnUse','width','10','height','10');
but it's not working.. if i set the individual attribute using setAtribute working fine.. how to solve this. i want set attribute in single line. please find the jsfidle link http://jsfiddle.net/ubLr4/18/