function GetWidth(){
var TBL_width = document.getElementById( wrap_tbl ).offsetWidth;
return TBL_width;
}
var w = GetWidth();
<input type="hidden" id="tbl" value= w />
这是可能的吗?
我想把 Java变本放在隐藏的投入要素的价值上。 请指导我如何做到这一点。
function GetWidth(){
var TBL_width = document.getElementById( wrap_tbl ).offsetWidth;
return TBL_width;
}
var w = GetWidth();
<input type="hidden" id="tbl" value= w />
这是可能的吗?
我想把 Java变本放在隐藏的投入要素的价值上。 请指导我如何做到这一点。
$("#tbl").val(w);
缩略语 文本:
document.getElementById("tbl").value = w;
本案中隐藏和“无隐藏”投入之间没有任何区别。
<><>Advice>: 如果您的<代码>GetWidth功能只有一个行文,而该行太复杂,你可以从该方法中提取。
function setWidth(){
var TBL_width = document.getElementById( wrap_tbl ).offsetWidth;
document.getElementById("tbl").value = TBL_width;
}
利用javascript to set the Value
property of theiridden elements:
var w=GetWidth();
document.getElementById( tbl ).value = w;
或j 模范式:
var w=GetWidth();
$( #tbl ).val(w);
这肯定不会奏效。
Look what you did with the element "wrap_tbl" ... you accessed it by using document.getElementById(). You can do the exact same thing to access hidden elements
document.getElementById( tbl ).value = w;
You could set the value use javascript.
document.getElementById( tbl ).value=w;
If you use jQuery, just $( #tbl ).val(w);
由于对投入的转让价值已经回答了一个问题,
你们是否需要把它作为寄送来的寄子?
如果没有,一项建议:您可使用以下方法:http://www.google.es/url?sa=t&rct=j&q=jquery%20data&source=web&cd=1&ved=0CCgQFjA&url=http://api.jquery.com/jery.data/&ei=7wOT-7QY-do Spw伊拉克第纳尔&Q;usg=AFQjEsJ9bnY3Uamp。
$( body ).data( myDesiredName , myDesiredValue );
并检索
alert($( body ).data( myDeesiredName )); //will alert myDesiredValue
这样,你就能够储存多种价值和变数,而不需要隐藏元素,
1. 高兴的编码......
How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.
I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...
Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...
Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...
I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...
Is it possible for someone to give me a few pointers on how to display a multidimensional array in the form of a bar graph? The array is multidimensional, with three elements in each part - and the ...
Is it possible to reload a form after file-input change? I have a form where the user can chose an image for upload. I also have a php script which displays that image resized. I only wonder if it ...
I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.