Select Span as a single element
See original GitHub issueI have the ability for users to insert some meta data (e.g. the day). it goes into the edit like this…
<span class="metaData">Wednesday </span>
there could be user text on either side of the span e.g.
My favourite day of the week is <span class="metaData">Wednesday </span> becuase I have PE at school.
I want to make it so the metaData span is treated as a single “lump”, e.g. if they click anywhere in it, it highlights the entire span. If they overwrite it, it gets rid of the entire span, etc.
Hopefully, this makes sense. ANy pointers would be much appriciated
Issue Analytics
- State:
- Created a year ago
- Comments:9 (3 by maintainers)
Top Results From Across the Web
The Content Span element - HTML - MDN Web Docs
The <span> HTML element is a generic inline container for phrasing content, which does not inherently represent anything.
Read more >how can i select only last span element in a div ? it should not ...
If you want to select the last span in a div, but only where there is more than one span in the div,...
Read more >Span HTML – How to Use the Span Tag with CSS
You can use the HTML span tag as a container to group inline elements together so you can style or manipulate them with...
Read more >Divs, Spans, Ids, and Classes
The span tag is an inline HTML element that is used to group a set of inline elements. Generally speaking, you use span...
Read more >.find() | jQuery API Documentation
A string containing a selector expression to match elements against. ... Only spans within p tags are changed to red while others are...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
In a simple implementation, you can do something like this: