Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Apply two Date Method consecutively on single object?

Tags:

javascript

I hope you have well with nice pleasure.

Please find me it is possible to apply two date method on single object. Because when we apply single method on date object answer is return in 'String' format. and Date method does not apply on string, only requires Object.

Code is here

        var date =  new Date();

        utc = date.getUTCString();

        // Problem is here i am want to conver
        // utc to object, then apply another function.

        var str  = utc.toDateString(); 
        // here is error shown in Console window

        document.write(utc);

My intention to ask answer. how can I apply two Date method on single Date object?

I believe , I am receiving good and positive reply soon.

like image 411
Zohaib Avatar asked Apr 27 '26 13:04

Zohaib


1 Answers

You can use querySelector() for this:

document.querySelector('#yes input').value = 'Changed!';
<div id="yes">
  <div>
    <input type="button" value="submit">
  </div>
</div>
like image 65
Amit Avatar answered Apr 29 '26 03:04

Amit