Search media with javascript

Question

For testing purposed I want to search through the media of the featured image. But I can’t seem to activate the search.

From the admin product detail page I now have:

// open featured image 
document.getElementById('postimagediv').getElementsByTagName('a')[0].click();

// input text string
document.getElementById('media-search-input').value = "test string";

Can’t seem to trigger the search with .click(), .focus() or .blur(). There’s also no button to hit because WP has a live search functionality.

0
, , Eric 3 years 2020-07-17T06:11:24-05:00 0 Answers 58 views 0

Leave an answer

Browse
Browse