Created
April 3, 2019 19:26
-
-
Save vivrichards600/7032395fe59d345d3a0163213e054fa3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var inputs = document.querySelectorAll('input'); | |
var labels = document.querySelectorAll('label'); | |
for (var currentInput = 0; currentInput < inputs.length; currentInput++) { | |
var inputHasLabel = false; | |
for (var currentLabel = 0; currentLabel < labels.length; currentLabel++) { | |
if (labels[currentLabel].htmlFor == inputs[currentInput].id) { | |
inputHasLabel = true; | |
} | |
} | |
if (inputHasLabel == false) { | |
inputs[currentInput].style = inputs[currentInput].style+"; border:10px dashed red;"; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment