Only set val for input and textarea

Tags like button have a value prop, but should have thier innerHTML set.
Also added a check on a non-jQuery object returned from a tag fn call.
This ensures the nodeType is an element
Rearangged var declarations.

Split the var declartions bewteen the main fn and the for loop to ensure
proper reset between elements. Particularly the $el was not reseting.
Actually reset $el