§
يوللانغان ۋاقتى: 2022-03-08

Hello! I want to search on a set number of items for it's data-tooltip information.

I don't know how to programme on this langage, so I'm trying to fuse some scripts.

This is the way I get the info whem it's simple text/button:
variable.textContent.includes('Hello world')

But how could I do the same to get that?

§
يوللانغان ۋاقتى: 2022-03-09
تەھرىرلەنگەن ۋاقتى: 2022-03-09
var buttons = document.querySelectorAll('button[data-tooltip]'); // query all buttons that contains 'data-tooltip' attribute
// var button = document.querySelector('button[data-tooltip="BLUE"]'); // query a button which has attribute data-tooltip="BLUE"
for (var i in buttons) {
    var button = buttons[i];
    console.log(button.getAttribute('data-tooltip'));
    concole.log(button.dataset.tooltip); // this work only for attribute which start with 'data-'
}
§
يوللانغان ۋاقتى: 2022-03-11
تەھرىرلەنگەن ۋاقتى: 2022-03-11

Awesome! Thank you very much <3

جاۋاب قايتۇرۇش

جاۋاب قايتۇرۇش ئۈچۈن كىرىش.

长期地址
遇到问题?请前往 GitHub 提 Issues。