Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can it be adapted to the native js method to obtain the current node text #390

Closed
OneSeven opened this issue Sep 3, 2021 · 2 comments
Closed

Comments

@OneSeven
Copy link

OneSeven commented Sep 3, 2021

<div>
    text document
    <span>span</span>
    das
</div>
<script>
    let text = document.querySelector("div").firstChild.nodeValue
    console.log(text.trim())
</script>
@mna
Copy link
Member

mna commented Sep 4, 2021

I think what you're asking for is a way to get the text content inside the div but before the span element? This comment may be what you're looking for: #287 (comment)

Hope this helps,
Martin

@OneSeven
Copy link
Author

OneSeven commented Sep 6, 2021

I think what you're asking for is a way to get the text content inside the div but before the span element? This comment may be what you're looking for: #287 (comment)

Hope this helps,
Martin

thanks

@OneSeven OneSeven closed this as completed Sep 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants