0

This is generated element by the plugin

<span class="leaflet-draw-draw-polyline">...</span>

I want to click on an element from some other part of the code.

How can I trigger click on this element without using ref on it?

1 Answer 1

1

Since the element seems to be completely out of a React component's scope, you could try either of the following:

  1. create a React component and use refs
  2. simply use document.getElementsByClassName() and .click()
Sign up to request clarification or add additional context in comments.

1 Comment

you just save my day! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.