alert with a variable in js code example Example: javascript alert variable var text = "hello world"; alert(text);