Skip to content

Instantly share code, notes, and snippets.

@frank-who
Last active February 29, 2016 08:13
Show Gist options
  • Save frank-who/62ffe651b07ef27aa525 to your computer and use it in GitHub Desktop.
Save frank-who/62ffe651b07ef27aa525 to your computer and use it in GitHub Desktop.
Bookmarklet: Show hidden form fields
//javascript:(function(){
// var is=document.getElementsByTagName("input");
// for(i=0;i<is.length;i++){
// if(typeof(is[i].attributes["type"])!="undefined" && is[i].attributes["type"].value.toLowerCase()=="hidden"){
// is[i].setAttribute("type","text");
// is[i].setAttribute("style","background-color:#FFFFE0;border:2px dashed #99CCFF;color:#000000;border-radius:0;font-size:12px;line-height:1;padding:4px 10px;height:auto");
// is[i].insertAdjacentHTML("beforeBegin", is[i].getAttribute("name"));
// }
// }
//})();
javascript:(function(){ var is=document.getElementsByTagName("input"); for(i=0;i<is.length;i++){ if(typeof(is[i].attributes["type"])!="undefined" && is[i].attributes["type"].value.toLowerCase()=="hidden"){ is[i].setAttribute("type","text"); is[i].setAttribute("style","background-color:#FFFFE0;border:2px dashed #99CCFF;color:#000000;border-radius:0;font-size:12px;line-height:1;padding:4px 10px;height:auto"); is[i].insertAdjacentHTML("beforeBegin", is[i].getAttribute["name"]); } } })();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment