javascript - Append to single element of array -


having trouble ‘p’ element value being appended both ‘reviewer-meta’ blocks. think issue may in append function 'p' element being appended review-comment-wrap elements. how append block element value b removed?

<div class="reviewer-meta">     <div class="author-attribute">value a</div>     <div class="author-attribute">value b</div>     <div class="review-comment-wrap">some value</div> </div>  <div class="reviewer-meta">     <div class="author-attribute">value a</div>     <div class="review-comment-wrap">some value</div> </div>   function runprogram(){     var theelements = $('.reviewer-meta').find('.author-attribute');      $(theelements).each(function(){         if(this.innerhtml == "value b"){             $(this).remove();            }     });     $('.review-comment-wrap').append('<p>new value</p>'); } runprogram(); 

common syntax typo. wrote = instead of == :

if(this.innerhtml == "value b"){ 

Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -