获取量程文本的值 [英] Get value of Span Text
问题描述
我有一个跨度 class =span
和一个隐藏字段 class =dropdown
。
然后我将使用php(我已经拥有)并使用隐藏字段的名称向我发送文本。 我该怎么做? I have a span with The I will then use php (I already have) and use the name of the hidden field to email me the text. How do I do it?
这篇关于获取量程文本的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
< script type =text / javascript>
document.getElementById('button1')。onChange = function(){
document.getElementById('hidden_field_id')。value = document.getElementById('span_id')。innerHTML;
}
< / script>
class="span"
and a hidden field class="dropdown"
.span
text changes, and I need to grab the text and set it as the value of the hidden field's value. <script type="text/javascript">
document.getElementById('button1').onChange = function () {
document.getElementById('hidden_field_id').value = document.getElementById('span_id').innerHTML;
}
</script>