To compare strings in JavaScript
1 .First make sure that the strings you are comparing are not null.
2.you can check if the strings are null by doing this
if (stringA == 'null')
This will return true if stringA is null.
Or you can do
if (stringA != 'null' && stringB != 'null')
3.Now that you made sure the strings are not null compare them like this
if (stringA == stringB) {}
Comparing Strings in JavaScript
To compare strings in JavaScript
1 .First make sure that the strings you are comparing are not null....
comparing strings javascript
Also tagged with one or more of these keywords: comparing strings, javascript
Web Design →
Javascript →
Using OnSubmit in JavaScriptStarted by Salwa, 18 Jul 2013 javascript, onsubmit event |
|
|
||
Web Design →
Javascript →
Downloading Javascript to iPodStarted by OneDes, 13 Jun 2013 downloading, javascript, to ipod |
|
|
||
Web Design →
Javascript →
Downloading JavaScript to BlackBerryStarted by OneDes, 13 Jun 2013 downloading, javascript and 1 more... |
|
|
||
Web Design →
Javascript →
Enabling JavaScript on a MacStarted by OneDes, 13 Jun 2013 enable, javascript, mac |
|
|
||
General chat →
Introduce Yourself →
Hello!Started by sephyleader, 03 Jun 2013 javascript, onsubmit event |
|
|
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users