Created
April 22, 2016 05:27
-
-
Save edinsoncs/93d2163e48458eb35ad51a8efbcf8fa6 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Nodos in javascript</title> | |
| </head> | |
| <body> | |
| <button id="abc"> | |
| <span>hola</span> | |
| </button> | |
| <script> | |
| //Nodos First-child in javascript | |
| var obtenemos_id = n(document).getElementById(findID('abc')); | |
| function n(document){ | |
| return document; | |
| } | |
| function findID(find){ | |
| return find; | |
| } | |
| function returnID(id){ | |
| return id; | |
| } | |
| function fAndL(f,l){ | |
| if(f.previousSibling) { | |
| console.log('hola'); | |
| } | |
| else { | |
| //console.log(l.previousSibling) | |
| function etiquet(html){ | |
| if(html){ | |
| function search(isHTML,c ){ | |
| console.log(isHTML + 'es una etiqueta <span> Hola, magia?'); | |
| } | |
| search(html) | |
| } | |
| } | |
| etiquet(l.previousSibling); | |
| } | |
| } | |
| fAndL(returnID(obtenemos_id.firstChild), returnID(obtenemos_id.lastChild)); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment