passing arguments to JavaScript function inside input field vs. from inside function

yyahmee

New Member
What are the pros/cons between the following two ways of passing/setting variables?\[code\]<input type="password" name="pw1" id="pw1" onkeyup="return passwordCheck(document.getElementById('pw1'), document.getElementById('pw2'))"/\[/code\]\[code\]function passwordCheck(first, second){...\[/code\]OR\[code\]<input type="password" name="pw1" id="pw1" onkeyup="return passwordCheck()"/\[/code\]\[code\]function passwordCheck(){var first = document.getElementById('pw1')var second = document.getElementById('pw2')...\[/code\]
 
Back
Top