Fix problem with use of attr instead of prop

Change the attr method to prop, because there is no 'tagName' attribute
 and for this situation we should use prop.