javascript - dynamically changing custom html values using jquery -


<div data-react-class="duration" data-react-props="{"startdate":"","enddate":""}"> 

i have in html. how can change startdate , enddate values in data-react-props using jquery?

you can use jquery data selectors

$("div[data-react-class='duration']").attr("data-react-props","{'startdate':'12-12-2017', 'enddate':'01-01-2018'}"); 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -