Capture updated text from h tag after change in input field : <p>I am new to Javascript.So please excuse me if I am asking anything silly. I have a sample Shiny application <a href="https://avinashr.shinyapps.io/statistics_dashboard/" rel="nofollow noreferrer">Statistics Dashboard</a> which can be used to find some basic statistical measures such as Mean, Median etc. for any metric. Users have to upload a csv file based on which the dashboard selects all the numeric variables within the file and provides an option to select any numeric variable to analyze as a dropdown. I want to add a javascript code in the application which will capture the updated measures (e.g. mean) after a user has selected a particular dimension from the dropdown. For example, suppose the default selected dimension in the dropdown window is "sales" and the corresponding mean is 325. If I select another dimension (suppose) "profit" then the mean changes to 37. Now I want to add a javascript/jquery code which will capture the mean value of 37 when I select "profit" (from "sales") from the dropdown. I have tried the <strong>.change</strong> event to check for the change in the dropdown selection and when there is a change, capture the mean value inside the <strong>h3</strong> tag. However, I am getting the previous mean value instead of the updated one i.e. I am getting 325 instead of 37 when I select "profit" (from "sales"). Hope I am clear on this. </p>

<p>Am I using the wrong event? How can I capture anything after a certain action occurs and the values are updated? </p>

<p>Feel free to let me know if you need any more details on my query. Looking forward to the help from the community.</p>
