add text and variable in window.alert code example Example: javascript alert variable var text = "hello world"; alert(text);