JavaScript - pass value to html
Asked By hiren dhameliya on 10-Apr-12 05:13 PM
hi,
please tell me how i set value of html tag using JavaScript....
<param name="flashvars" value="mp3=Songs/qs(1)/qs(2)" />.
<script type ="text/javascript" >
function qs(search_for) {
var query = window.location.search.substring(1);
var parms = query.split('&');
for (var i = 0; i < parms.length; i++) {
var pos = parms[i].indexOf('=');
if (pos > 0 && search_for == parms[i].substring(0, pos)) {
return parms[i].substring(pos + 1); ;
}
}
return "";
}
i want set value from java script ........
reply me as soon as possible ..
thanks
Jitendra Faye replied to hiren dhameliya on 11-Apr-12 12:31 AM
This is example for change value of param tag using Javascript-
function textbox(Obj) {
objVal=Obj.value;
document.getElementById('experiment').innerText='<param name = "url" value = "http://127.0.0.1/upload.lasso?expt=' + objVal + '>"';
document.getElementById('url').value = 'http://127.0.0.1/upload.lasso?expt=' + objVal;
return true;
}
</script>
<input type=text onKeyUp="return textbox(this)" name="expt">
<SPAN id=experiment></SPAN>
<object type="application/x-java-applet;version=1.4.1" width= "290" height= "290" >
<param name="archive" value="dndlite.jar"/>
<param name="code" value="com.radinks.dnd.DNDAppletLite"/>
<param name="name" value="Rad Upload Lite"/>
<param id="url" name="url" value="" />
</object>
Refer this code as a helper.