Could I use a src attribute on a p tag to load in raw text?


#1

Question

Could I use a src attribute on a p tag to load in raw text?

Answer

No. Unlike the global id attribute, the src attribute can only be applied to specific tags of which the p tag is not included. In other words, not all attributes are available to every tag. To find out which attributes are available to every tag, take a look at this list of global attributes.


FAQ: Learn HTML Elements – Intro to HTML – Review
#3

Where is i can find information about link between raw text and src attribute?

p.s. it’s my first message at the codeacademy forum, congrat me!


#4

There is no link between the two. All HTML is raw text. src is an attribute that takes a URI as a value. Only a handful of elements have this attribute.

img
audio
video
embed
iframe
source
script

As for populating P elements from an external source, that would have to be done in the DOM using AJAX, which will come up later in the course. For now, be content to write all content directly to the HTML document raw source.