url: NASA (@nasa) • Instagram photos and videos
@evolut1010 thanks for asking this question. Because of the way Distill extracts data from DOM, it is not possible to use JS selectors to select custom fields.
What were you trying to achieve using JS?
JS can be used to modify the DOM arbitrarily and monitor the modified content. Here is an example:
let img = document.querySelector('img');
let el = document.querySelector('.target');
target.textContent = img.src;
This script updates and monitors target’s content.
Using the custom fields would have been slightly more convenient to monitor an img’s src, rather than having to inject the url into a secondary node’s textContent.
Monitoring img’s src should be straightforward using CSS or XPath. Was there a specific need to do that using JS?