Javascript: Difference between revisions
Jump to navigation
Jump to search
(Created page with "== Basic == === Alert/prompt === <syntaxhighlight lang="javascript"> alert('Windows Popup text'); prompt('Windows Popup Text and entry line'); </syntaxhighlight> === Html Ta...") |
|||
Line 30: | Line 30: | ||
var myVariable = 10; | var myVariable = 10; | ||
var myVariable = "some string"; var myVariable = 'some string'; var myVariable = 'it \'s easy'; | var myVariable = "some string"; var myVariable = 'some string'; var myVariable = 'it \'s easy'; | ||
</syntaxhighlight> | |||
=== Comparison === | |||
* Less: < | |||
* Greater: > | |||
* equal (value): == | |||
* equal (value and type: === | |||
* function type of variable | |||
<syntaxhighlight lang="javascript"> | |||
alert(typeof myVariable); | |||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 13:43, 29 October 2017
Basic
Alert/prompt
alert('Windows Popup text');
prompt('Windows Popup Text and entry line');
Html Tag
<!DOCTYPE html>
<html>
<head>
<title>Java script Demo</title>
</head>
<body>
<h1>Titre niveau 1</h1>
<script>
alert('your javascript here!');
</script>
<script src="js/app.js"></script>
Variables
var myVariable;
var myVariable = 10;
var myVariable = "some string"; var myVariable = 'some string'; var myVariable = 'it \'s easy';
Comparison
- Less: <
- Greater: >
- equal (value): ==
- equal (value and type: ===
- function type of variable
alert(typeof myVariable);