Selecting an element through a html tag such as `data-element="#card__body"

40 views Asked by At

In Intro.JS, I would like to know how to potentially focus on an element whilst defining an elements selector from within the HTML like how its done with the JS version element: document.querySelector('.card-demo')

The closest example to being able to configure a step through HTML is in this example from the website https://introjs.com/docs/examples/basic/hello-world.

In that example data-title="Farewell!" data-intro="And this is the last step!" the data attributes are added to the html element that is being selected. However I would like to be able to define this separately and select the element after.

Using the same example from the website I would like to be able to define the step html separately potentially with a data- attribute that can define the class/ID that is to be selected.

E.g. <div data-attribute=".card__image" data-title="Farewell!" data-intro="And this is the last step!" or a another way if possible.

0

There are 0 answers