The cite attribute of the <q> element is used to set the source URL of a quote. The source won’t get displayed on the web page, but it is beneficial for the screen readers.
Let us now see an example to implement the cite attribute of the <q> element −
Example
<!DOCTYPE html> <html> <body> <h2>What we want?</h2> <p>PETA states, <q cite="https://legacy.peta.org/why-give/">We are the largest animal rights organization in the world, with more than 6.5 million members and supporters worldwide. We need your continued support in order to stop cruelty to animals wherever it occurs.</q> </p> </body> </html>
Output
In the above example, we have set a quote using the <q> tag −
<p>PETA states, <q cite="https://legacy.peta.org/why-give/">We are the largest animal rights organization in the world, with more than 6.5 million members and supporters worldwide. We need your continued support in order to stop cruelty to animals wherever it occurs. </q>
Since the quote is taken from the official website, it’s always necessary to give credit by quoting it or using cite attribute −
cite="https://legacy.peta.org/why-give/"