If it’s a global variable then window[variableName]
or in your case window["onlyVideo"]
should do the trick.
More Related Contents:
- Need to take variables from user input (Javascript ) [closed]
- How to use a variable for a key in a JavaScript object literal?
- Define a global variable in a JavaScript function
- How to interpolate variables in strings in JavaScript, without concatenation?
- Static variables in JavaScript
- Javascript Regex: How to put a variable inside a regular expression? [duplicate]
- How to check a not-defined variable in JavaScript
- JavaScript variable definition: Commas vs. Semicolons
- How can I refer to a variable using a string containing its name?
- JavaScript check if variable exists (is defined/initialized)
- “Variable” variables in JavaScript
- Pass vars to JavaScript via the SRC attribute
- Set “this” variable easily?
- Why is the variable `closed` being logged as `false`, if I define it globally as `0`?
- Variables set during $.getJSON function only accessible within function
- Is there a better way of writing v = (v == 0 ? 1 : 0); [closed]
- Setting a variable equal to another variable [duplicate]
- JavaScript Dynamic Variable Names
- Redeclaring a javascript variable
- javascript variable scope in the IF statement
- When/why to prefix variables with “$” when using jQuery? [duplicate]
- Prepending “http://” to a URL that doesn’t already contain “http://”
- What does immutable mean?
- How do I use this JavaScript variable in HTML?
- How to access a JavaScript variable from code behind in asp.net
- JSON to string variable dump
- What is the best method to convert floating point to an integer in JavaScript?
- Passing a local variable from one function to another
- Get all Javascript Variables?
- Print / display a JavaScript variable’s name instead of it’s value