Homoeroticism is sexual attraction between members of the same sex, either male–male or female–female. Although related, it is considered distinct from homosexuality in that it refers specifically to the desire itself, which can be temporary, whereas "homosexuality" implies a more permanent state of identity or sexual orientation. It is a much older concept than the concept of homosexuality, which originated in the 19th century, and examples of homoeroticism can be found throughout the history of world arts and literature.
Homoerotic subtext in books, television, film, and other media can be either deliberate or accidental. For example, it was sometimes used deliberately as a way to avoid censorship in Hollywood films when the Hays Code, which banned depictions of homosexuality, was in effect from 1930-1968. On the other hand, some creators have been shocked to realize that fans have interpreted the platonic "bromance" between two (typically) male characters as homoerotic and started creating slash fanworks about them. In recent years, some creators have deliberately played up homoeroticism between same-sex characters in an attempt to attract slash fans, but this can backfire and lead to accusations of queerbaiting if the two characters are never allowed to enter an actual romantic or sexual relationship.