I need to change the link in my div which has <div id="0">
.
My div
code:
<div id="0">
<div id="header_color" class="spacing-top context_menu">
<div class="row">
<div contenteditable="true" class="col-md-12 heading-sm28">Lets get started on project.</div>
<div contenteditable="true" class="col-md-12 smalltxt-center">Lorem Ipsum is simply dummy text of the test change link.</div>
<div class="col-md-12 center context_menu context_link"><a href="http://google.com" target="_blank" class="btntst-back">Get in touch</a></div>
</div>
<div class="row">
<div contenteditable="true" class="col-md-12 heading-sm28">Lets get started on project.</div>
<div contenteditable="true" class="col-md-12 smalltxt-center">Lorem Ipsum is simply dummy text of the test change link.</div>
<div class="col-md-12 center context_menu context_link"><a href="http://google.com" target="_blank" class="btntst-back">Get in touch</a></div>
</div>
</div>
</div>
The command I am trying to use is -
$(id).children().attr("href",'http://example.com');
Value of id I am getting is -
var id = '#'+this.selectedDivCodesub+' '+".clickedDiv";
which is - #0 .clickedDiv
I am sure I am doing something wrong while getting the id
. Note that I am using clickedDiv because I am trying to change the address of the clicked link.