If you’re trying to match the string(wrap the text inside single/double quote). Use the below code.
function check(el) {
if (el === 'this') {
alert("contain!");
return el;
} else {
alert("not contain this keyword");
}
}
check('this');
More Related Contents:
- Input type="text" with select functionality after clicking on Input type="text"
- WordPress or building site on own? Which is more cost efficient?
- simple form input request in angular
- Finding the max value of an attribute in an array of objects
- How to get the entire document HTML as a string?
- How can I listen to the form submit event in javascript?
- Is JavaScript an untyped language?
- How to transpose a javascript object into a key/value array
- What is {this.props.children} and when you should use it?
- Resolve Javascript Promise outside the Promise constructor scope
- Gmail Extension, sendMessage to background from page context
- How to avoid freezing the browser when doing long-running computations in Javascript
- JavaScript design pattern: difference between module pattern and revealing module pattern?
- JavaScript performance difference between double equals (==) and triple equals (===)
- JavaScript: get all months between two dates?
- Remove specific HTML tag with its content from javascript string
- Importing CSS files in Isomorphic React Components
- How do I wrap a text selection from window.getSelection().getRangeAt(0) with an html tag?
- Sort an array so that null values always come last
- Commenting Regular Expressions
- How to create a collapsing tree table in html/css/js?
- Make an image follow mouse pointer
- What is jQuery(document) vs. $(document)
- How do I set path while saving a cookie value in JavaScript?
- Datatables TypeError: c is undefined
- Using the parseInt() function and the radix parameter with ternary operators
- Toggle divs without using Javascript
- how ( stop,exit ) video in webrtc navigator user media JavaScript
- Published extension doesn’t work with chrome API listeners inside onInstalled
- How to dynamically import SVG and render it inline