Q: change anchor tag inner html by title using javascript i have an anchor tag as follows:
<a title="mytagname">My name is akira</a>

I want to write a javascript so that I can search the a tag with the title value and change the inner html of that.

A: function changeContentByTagName(tagName, newContent) {
  var elem = document.querySelector('a[title='+ tagName +']');
  if (elem) {
    elem.innerHTML = newContent;
  }
}

usage: changeContentByTagName('mytagname', 'My name is Tetsuo');

A: Or if you are using jQuery
function serchAndChange (title, content){
    var selector = '[title='+title+']';
    var $element = $(selector);
    if($element){
        $element.html(content);
    }
}

