Module 6 - Lesson 9
jQuery Variables
Lesson Overview
In this short lesson, I’d like to explain what variables are and how we can use them when writing our jQuery code.
Video Chapters
Code Examples
// Example 1
var sampleVar = "Hello!";
alert(sampleVar);
// Example 2 - number
var One = 1;
var Two = 2;
alert(One + Two); // 3
// Example 3 - text string
var One = "1";
var Two = "2";
alert(One + Two); // 12
// Example 4
var $paragraph = $('p');
$paragraph.text('this is new');
$paragraph.text(sampleVar);
Login to your Account
If you're a DSA Student, please log in to your account to access the course content.
Sorry, you don't have access to this content.
It looks like you're not enrolled in Divi Stylist Academy.
