如何使用javascript连接文本框和dropdonwlist [英] How to concatenate textbox and dropdonwlist using javascript
本文介绍了如何使用javascript连接文本框和dropdonwlist的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有以下文本框和下拉列表
名称rajesh textbox1
电子邮件@ gmail.com dropdownlist1
i想要连接文本框和下拉列表,我希望输出如下
rajesh @gmail。 com
如何使用javascript连接文本框和dropdonwlist
< b>我尝试了什么:
i have textbox and dropdownlist as follows
Name rajesh textbox1
Email @gmail.com dropdownlist1
i want to concatenate textbox and dropdownlist and i want the output as follows
rajesh@gmail.com
how to concatenate textbox and dropdonwlist using javascript
What I have tried:
i have textbox and dropdownlist as follows
Name rajesh textbox1
Email @gmail.com dropdownlist1
i want to concatenate textbox and dropdownlist and i want the output as follows
rajesh@gmail.com
how to concatenate textbox and dropdonwlist using javascript
推荐答案
尝试
try
var text = document.getElementById('yourtextboxID').value;
var ddl = document.getElementById('yourdropdownlistID').value; // provided value and text are same.
var result = text + ddl;
这篇关于如何使用javascript连接文本框和dropdonwlist的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文