Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- How can I define a variable inside a function to be called by an event
- function testSet(elmA,elmB) {
- elmA.onclick = function() {
- elmB.value = "ok";
- };
- }
- testSet(document.getElementById('a'),document.getElementById('b'));
- var globalElmB = something;
- function testSet(elmA,elmB){
- globalElmb = elmB;
- elmA.onclick=function(){
- globalElmb.value="ok";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment