How Can I print users selected? [closed]
up vote
-2
down vote
favorite
I have a little problem with JavaScript! I want to print users selected thing in Javascript!
For Example:
We have a list
If users select banana I wanna return it like this "You selected banana"(Sorry my bad English)
javascript
closed as unclear what you're asking by Utkanos, charlietfl, Lux, Dan O, Gary Nov 11 at 4:52
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
up vote
-2
down vote
favorite
I have a little problem with JavaScript! I want to print users selected thing in Javascript!
For Example:
We have a list
If users select banana I wanna return it like this "You selected banana"(Sorry my bad English)
javascript
closed as unclear what you're asking by Utkanos, charlietfl, Lux, Dan O, Gary Nov 11 at 4:52
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
1
Welcome to SO. It's a place where we help you with your code; we don't write code for you. Please see How to ask a good question. Show us what you've tried, then we can help, and be sure to post all relevant code in the question.
– Utkanos
Nov 10 at 19:28
Please, share what you already have done. Thank you.
– Tornike Shavishvili
Nov 10 at 19:49
add a comment |
up vote
-2
down vote
favorite
up vote
-2
down vote
favorite
I have a little problem with JavaScript! I want to print users selected thing in Javascript!
For Example:
We have a list
If users select banana I wanna return it like this "You selected banana"(Sorry my bad English)
javascript
I have a little problem with JavaScript! I want to print users selected thing in Javascript!
For Example:
We have a list
If users select banana I wanna return it like this "You selected banana"(Sorry my bad English)
javascript
javascript
edited Nov 10 at 19:29
asked Nov 10 at 19:26
Maksat Orazsahedow
82
82
closed as unclear what you're asking by Utkanos, charlietfl, Lux, Dan O, Gary Nov 11 at 4:52
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as unclear what you're asking by Utkanos, charlietfl, Lux, Dan O, Gary Nov 11 at 4:52
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
1
Welcome to SO. It's a place where we help you with your code; we don't write code for you. Please see How to ask a good question. Show us what you've tried, then we can help, and be sure to post all relevant code in the question.
– Utkanos
Nov 10 at 19:28
Please, share what you already have done. Thank you.
– Tornike Shavishvili
Nov 10 at 19:49
add a comment |
1
Welcome to SO. It's a place where we help you with your code; we don't write code for you. Please see How to ask a good question. Show us what you've tried, then we can help, and be sure to post all relevant code in the question.
– Utkanos
Nov 10 at 19:28
Please, share what you already have done. Thank you.
– Tornike Shavishvili
Nov 10 at 19:49
1
1
Welcome to SO. It's a place where we help you with your code; we don't write code for you. Please see How to ask a good question. Show us what you've tried, then we can help, and be sure to post all relevant code in the question.
– Utkanos
Nov 10 at 19:28
Welcome to SO. It's a place where we help you with your code; we don't write code for you. Please see How to ask a good question. Show us what you've tried, then we can help, and be sure to post all relevant code in the question.
– Utkanos
Nov 10 at 19:28
Please, share what you already have done. Thank you.
– Tornike Shavishvili
Nov 10 at 19:49
Please, share what you already have done. Thank you.
– Tornike Shavishvili
Nov 10 at 19:49
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
You can use a select
and add a change event listener.
var select = document.querySelector('select'),
res = document.querySelector('p');
select.addEventListener('change', function(e){
res.textContent = 'You selected '+this.value;
});
<select>
<option value="Apple">Apple</option>
<option value="Coffe">Coffe</option>
<option value="Banana">Banana</option>
</select>
<p></p>
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
You can use a select
and add a change event listener.
var select = document.querySelector('select'),
res = document.querySelector('p');
select.addEventListener('change', function(e){
res.textContent = 'You selected '+this.value;
});
<select>
<option value="Apple">Apple</option>
<option value="Coffe">Coffe</option>
<option value="Banana">Banana</option>
</select>
<p></p>
add a comment |
up vote
0
down vote
accepted
You can use a select
and add a change event listener.
var select = document.querySelector('select'),
res = document.querySelector('p');
select.addEventListener('change', function(e){
res.textContent = 'You selected '+this.value;
});
<select>
<option value="Apple">Apple</option>
<option value="Coffe">Coffe</option>
<option value="Banana">Banana</option>
</select>
<p></p>
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
You can use a select
and add a change event listener.
var select = document.querySelector('select'),
res = document.querySelector('p');
select.addEventListener('change', function(e){
res.textContent = 'You selected '+this.value;
});
<select>
<option value="Apple">Apple</option>
<option value="Coffe">Coffe</option>
<option value="Banana">Banana</option>
</select>
<p></p>
You can use a select
and add a change event listener.
var select = document.querySelector('select'),
res = document.querySelector('p');
select.addEventListener('change', function(e){
res.textContent = 'You selected '+this.value;
});
<select>
<option value="Apple">Apple</option>
<option value="Coffe">Coffe</option>
<option value="Banana">Banana</option>
</select>
<p></p>
var select = document.querySelector('select'),
res = document.querySelector('p');
select.addEventListener('change', function(e){
res.textContent = 'You selected '+this.value;
});
<select>
<option value="Apple">Apple</option>
<option value="Coffe">Coffe</option>
<option value="Banana">Banana</option>
</select>
<p></p>
var select = document.querySelector('select'),
res = document.querySelector('p');
select.addEventListener('change', function(e){
res.textContent = 'You selected '+this.value;
});
<select>
<option value="Apple">Apple</option>
<option value="Coffe">Coffe</option>
<option value="Banana">Banana</option>
</select>
<p></p>
answered Nov 11 at 3:40
hev1
5,4233527
5,4233527
add a comment |
add a comment |
1
Welcome to SO. It's a place where we help you with your code; we don't write code for you. Please see How to ask a good question. Show us what you've tried, then we can help, and be sure to post all relevant code in the question.
– Utkanos
Nov 10 at 19:28
Please, share what you already have done. Thank you.
– Tornike Shavishvili
Nov 10 at 19:49