Javascript/getAttribute

解説 指定の要素について名前付けされた属性の値を返す。
sample1
sample1code
function s1Func(){
  var s1Text = document.getElementById("s1Text");
  var getType = s1Text.getAttribute("type");
  alert(getType);
}