Reputation: 232
i want to design a dynamic modal-dialog for my component. i get width and height from input and set these to my content div. and may be i have several modal-dialog in one page. how can make it with java script and jQuery ?
Upvotes: 0
Views: 139
Reputation: 44813
You can try to use
as in $( "#mydiv" ).css( "color", "green" )
You can use it with any jquery selector/id, not just class.
$( "#mydiv [name='changeme']" ).css( "color", "green" );
Upvotes: 2
Reputation: 2500
Use as follows :
$( "#mydiv" ).css( "width", $("#widthtextbox').val() );
And
$( "#mydiv" ).css( "height", $("#heighttextbox').val() );
Where widthtextbox and heighttextbox and the ids of the textbox from where you are trying to use values, and mydiv is the div to add css to.
hope this helps you.
Upvotes: 1