'Accesing DOM element

This can be a very basic question, but I'm really stuck.

I need to get out the values out of this element:

enter image description here

But I get stuck here, and can´t access to every pair key/value individually:

 alert(info.draggedEl.dataset.event);

enter image description here

Thanks for your help.



Solution 1:[1]

You are in the need of JSON.parse(), once this is done, you will be able to access the data. Here's what it looks like from a code perspective.

const data = JSON.parse('{\"title\": \"uno\"}'
console.log(data)
// Output: {title: 'uno'}

console.log(data.title)
// Output: uno

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1