To Use this Template:
NOTE: ISSUES ARE NOT FOR CODE HELP - Ask for Help at https://gitter.im/FreeCodeCamp/Help
Steps To Reproduce: Go to the challenge and try it
current version of Firefox
Where is your code?
Sorry. Pasting it wasn't working properly. Here is a pertinent screenshot.
You should use .html()
instead of .text()
for this challenge.
This part of the instructions may be the cause of confusion:
jQuery also has a similar function called
.text()
that only alters text without adding tags.
It could be rewritten so it's clear to students that .text()
will not evaluate the tags in the string input as HTML and instead treat them as part of the text. I'm not sure if it isn't already clear enough, though.
In any case, please use the Help Chat first for help on the challenges before submitting a bug report.
Thank you for the reply, sir. However, I tried it with .html as well as with .text and it still did not work. Please go to this challenge amd see for yourself. If I am makimg a mistake I do not knlw what it is. I have tried it any number of ways and it does not work.
In your original code, you were missing the #
in front of target4
.
@alistermada Thanks for the for the clarification, we could add a test to check campers are not reading through the lines, and getting confused?
Make sure you are using
.html()
and not.text()
or something on similar lines.
@raisedadead Sounds like a good idea to me.
Thank you. I can't believe I missed that.
I and others are using .html (and trying em instead of i) to no avail. Clicking "Run Test" does not return an error or a success message, nothing happens. Others reports here of same issue with what I assume is exactly correct code:
`$(document).ready(function() {
$("#target1").css("color", "red");
$("#target4").html("<em>$target4</em>");
});`
I'm guessing it's correct because it does change the text of target 4 to italics within the codecamp editor or in a separate environment like cloud9 or codeanywhere.com etc.
@texxs It should be #target4
instead of $target4
between the tags.
Ya got me on that one! Thanks. :)
Is this still and issue? and if so what is the exact issue? It seems like the test in staging was updated to look for em tags and the text about .text seems clear enough to me. Though seems like an aside that may not be needed since the .text method isn't relevant to what is being looked for.
If I were to draw issues with this one it would be the following.
.wrapInner
, since it will do what is looked for adding tags without changing the text, inside of #target4
$('#target4').wrapInner('<em></em>')
where as using .html
you have to add the text again.
Using .wrapInner
will pass the test by the way, so should a test be added to check that .html
is being used?
Just looking for some clarification?
removed solution by mod
this worked for me
@cinquemason
Please don't post your solution on here. You could help people at FreeCodeCamp Chat Room or Forum. GitHub Issues are for reporting bugs on the website only.
Happy Coding!
Most helpful comment
@texxs It should be
#target4
instead of$target4
between the tags.