jQuery: Get Child object with specific ID

First some HTML:

<div> Request: <b> Node: </b><span>33947</span> </div> 

Than some JavaScript:

$request = $('#tmcl-request'); $newrequest = $request.clone(); 

And now the question: I want to change the inner HTML of the <span> from the $newrequest object.

How to do this?

Thanks, Bigbohne

1 Answer

$('#tmcl-request').find('#node').html('whatever you want your html to be'); 

Thought, if you will have multiple nodes it's better to use a class instead of an id, so

$newrequest.find('#node').html('your html'); 
0

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like