+ 1
How can I take an id of element with textbox and how to insert id to my $("") place?
I have an input, button and I have an p. I want to take id of p from my textbox and when I click the button, the text of p will change. I can take id from my textbox with val() method, but how to insert it to $("what I must write")?
7 ответов
+ 2
thank you even if it is for javascript. Are there anyone who knows jQuery?
+ 1
We get id from p and manipulate it in jquery code. For instance: css. But u can explore it for other purposes.
If I understood you correctly...
<p id="textarea"></p>
$("p#textarea").css({"color": "red", "font-size": "200%"});
+ 1
$( "#"+$(".myTextbox").val() );
+ 1
thank you so so much andres, I don't know why you are getting minus from someone but you are awesome for me :)))
+ 1
You just started jQuery 12 mins ago andres :)))
+ 1
I just started the course but I have a tad of knowledge about jQuery... I used JavaScript logic with jQuery code
0
So you want to use the id in the textbox?
I don't know jQuery, but this JavaScript example should help:
var textbox = document.getElementById("myTextbox");
var other = document.getElementById(textbox.value);