Can i select a specific class using id

$(".modal-body").html(response.data);

Open in new window


am i able to get this class by using i Id to isolate it from other classes.



<div class="modal fade show" id="newModalWindow" tabindex="-1" role="dialog" aria-labelledby="newModalTitle" style="padding-right: 15px; display: block;"><div class="modal-dialog modal-dialog-centered modal-sm" role="document"><div class="modal-content"><div class="modal-header"><h5 class="modal-title" id="newModalTitle">Edit Note</h5><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button></div><div class="modal-body" style="padding: 1rem;"><form id="update-note-form" class="form-horizontal">
							<div class="form-group">
							<label class="col-md-12 control-label" for="textarea">Note</label>
							<div class="col-md-12">                     
								<textarea class="form-control" form="update-note-form" id="TEXT" name="TEXT">edit deal note</textarea>
								<input id="noteID" name="noteID" type="hidden" value="">
								<input id="subaction" name="subaction" type="hidden" value="update-note">
							</div>
							</div>			
						</form>
							</div><div class="modal-footer"><button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button><button id="update-Note" type="button" class="btn btn-success">Save</button></div></div></div></div>

Open in new window

Alex LordAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Chris StanyonWebDevCommented:
Sure:

$("#newModalWindow .modal-body")

Open in new window

leakim971PluritechnicianCommented:
I like this notation too :
$(".modal-body", "#newModalWindow")

all element in id="newModalWindow" :
$("*", "#newModalWindow")
Zakaria AcharkiAnalyst DeveloperCommented:
You could use the jQuery method find() for this like :

$("#newModalWindow").find(".modal-body");

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Zakaria AcharkiAnalyst DeveloperCommented:
Our suggestions work for you @Alex?
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
jQuery

From novice to tech pro — start learning today.