- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
how can i set input number from input text as variable x ?
setTimeout(function(){
intel.xdk.player.playSound(intel.xdk.webRoot + "sounds/1.wav");
}, x);
x is variable from input text box how i can do it ?
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Use getElementById to get the value from the input box.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
sorry any example code ?>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
$(document).on("click", ".uib_w_3", function(evt)
{
var x = document.getElementById("input");
x=x*1000 ;
setTimeout(function() { intel.xdk.player.playSound(intel.xdk.webRoot + "sounds/1.wav"); }, x);
intel.xdk.player.playSound(intel.xdk.webRoot + "sounds/1.wav");
});
>>>>>> not work
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
First of all, as I mentioned in the other thread the intel.xdk.webRoot will not work. Use this code to get the webroot path.
// get the webroot var rootpath = window.location.href ; rootpath = rootpath.substring( 0, rootpath.lastIndexOf('/') ) ; // if it is a real iOS device the webroot is "/" var ua = navigator.userAgent; if( !window.tinyHippos && ua.match(/(ios)|(iphone)|(ipod)|(ipad)/ig) ) { // it's not an emulator and it's iOS rootpath = "" ; }
Next, for your text input box value, you have to specify ID for the input box, like this :
<input id="settime" type="text">
and in Javascript get the value of the input box through getElementByID like this:
var x= document.getElementById("settime").value;
If you are new to HTML5 I would encourage you to learn from W3schools.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks too much :)

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page