Hi,
I want to know about the following code which are given below?
Code
if ($(this).parent().is('span')) {
$(opt).show();
$(span).replaceWith(opt);
Why are we use $(this).parent().is('span') and
$(opt).show();
$(span).replaceWith(opt);
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Jul 7, 2015, 1:08 AM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Jul 22, 2015, 3:45 AM EDT
Muralishankar Sundaram114 reputationPosted Jul 22, 2015, 2:05 AM EDT
if ($(this).parent().is('span'))// its validating parent element is 'span' tag
$(opt).show();//showing the 'opt' element
$(span).replaceWith(opt); // replacing the span element with the opt element.
Regards,