Do Field Options work with Javascript?

This seems like something simple, but I can’t figure it out and can’t find an example in the Docs. How do you use the field options with JavaScript? I’d like to get the src attribute from an img. They work if I use the same selector in CSS.

example:
url: NASA (@nasa) • Instagram photos and videos
javascript: document.querySelector(‘img[alt*=“Photo by”]’)

@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;
target;

This script updates and monitors target’s content.

OK…That is good to know they are not supported with javascript.

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?