Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //JavaScript quick info basic
- console.log(); <!-- Only For Developer Mode -->
- window.document.write();
- document.write();
- window.confirm();
- confirm();
- window.alert();
- alert();
- window.document.getElementById();
- document.getElementById();
- window.document.getElementById("id here").innerHTML = value;
- document.getElementById("demo").innerHTML = "Paragraph changed.";
- <!-- Long Distance traverse -->
- innerHTML
- tagName
- console.log(contentDiv.innerHTML);
- document.write(contentDiv.tagName);
- prompt('Please Input Data'); // this same <input /> and will display popup
- window.prompt('insert text'); //this same <input/> and will display popup
- parseInt // here parseInt has been used indicate to integer (as a number)
- addEventListener // usage like btnChangeText.addEventListener('click',name of function,false);
- <!-- using array literal in JavaScript -->
- var array_number = [1,2,3,4,5,6,7,8,9,'Hello World!']; // array literal
- window.document.write(array_number[0]); // when will go out of the range then will show undefine
- length
- window.document.write(array_number.length);
- There are 2 types of literal . 1 is array literal and 2 is object literal
- <!-- The Below Example Is json Formate where will stay [] and data will do into it as an object literal-->
- [
- {name: 'Afghanistan', code: 'AF'},
- {name: 'Åland Islands', code: 'AX'},
- {name: 'Albania', code: 'AL'}
- ]
- <!-- -->
- <script>
- // window.name = Firstname LastName;
- // var name = 'H T';
- name = 'another H T';
- // this.alert(this);
- // window.alert(this);
- // window.confirm('Are you sure?');
- // window.document.write('Hellow World');
- // window.document.writeln('Hello World');
- // console.log('hello');
- // this.console.log('hello');
- // alert(name);
- // this.console.log(window.name);
- /*
- null is object
- true or false boolean
- 1,2....etc like this is number
- anything in '' or "" that are string
- like this 555555555555555*'abc' is NaN but a number
- */
- var what_type = 555555555555555*'abc';
- console.log(what_type);
- console.log(typeof what_type);
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement