Freecodecamp: <em> is italicizing for some reason with this code

Created on 27 Jan 2017  路  8Comments  路  Source: freeCodeCamp/freeCodeCamp

Challenge Change Text Inside an Element Using jQuery has an issue.
User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.87 Safari/537.36.
Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:


<script>
  $(document).ready(function() {
    $("#target1").css("color", "red");
    $("#target4").html("<em> #target4 </em>");
  });
</script>

<!-- Only change code above this line. -->

<div class="container-fluid">
  <h3 class="text-primary text-center">jQuery Playground</h3>
  <div class="row">
    <div class="col-xs-6">
      <h4>#left-well</h4>
      <div class="well" id="left-well">
        <button class="btn btn-default target" id="target1">#target1</button>
        <button class="btn btn-default target" id="target2">#target2</button>
        <button class="btn btn-default target" id="target3">#target3</button>
      </div>
    </div>
    <div class="col-xs-6">
      <h4>#right-well</h4>
      <div class="well" id="right-well">
        <button class="btn btn-default target" id="target4">#target4</button>
        <button class="btn btn-default target" id="target5">#target5</button>
        <button class="btn btn-default target" id="target6">#target6</button>
      </div>
    </div>
  </div>
</div>

help wanted discussing

All 8 comments

Thanks for the report.

The spaces in between your code are causing the challenge to fail, well this should be fixed in the tests.

And to clear your confusion with the difference between <i> and <em>, check this:
https://developer.mozilla.org/en/docs/Web/HTML/Element/em

Tagging as help wanted.

/cc @freeCodeCamp/moderators should we add the link to clarify the difference, while updating the test to allow spaces?

@raisedadead I think test should allow spaces (since we are testing whether the user knows how to use the functionality rather than the particular text they are using).

Also, this challenge won't be the right place to differentiate between <i> and <em> in my opinion. I will work on fixing the test if needed. Let me know.

@raisedadead I like the idea of talking a little bit about the difference between <i> and <em>. I've seen couple issues here and there about people wanting to change it so it would be nice to clarify to those who are confused.

Yup, I agree that a clarification is required, may be just adding a MDN link should suffice.

Yes please, maybe a one liner something along the lines of:
Check this [link](< path to MDN>) to know more on the difference between <i> and <em> and their uses

ok. I will work on this

Update: I got busy with other 2 PRs. will work on this today.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kokushozero picture kokushozero  路  3Comments

robwelan picture robwelan  路  3Comments

SaintPeter picture SaintPeter  路  3Comments

danielonodje picture danielonodje  路  3Comments

ar5had picture ar5had  路  3Comments