0

ptag_to-option.js

 2 years ago
source link: https://gist.github.com/Ambrozia/9153f2623da276aee4465a025434bc7c
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

ptag_to-option.js · GitHub

Instantly share code, notes, and snippets.

//Making the select box from the p tags var optionBox = document.getElementsByClassName("contact-options")[0];

if (optionBox != undefined) {

var ptags = optionBox.getElementsByTagName("p"); var selectBox = document.getElementById("ContactFormWHATCANWEHELPYOUWITH?");

for (var i = 0; i < ptags.length; i++) {

var e = ptags[i]; optionBox.remove(e); var o = document.createElement('option'); o.innerText = e.innerText;

selectBox.appendChild(o); } }


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK