How can I get the <input /> value in a blazor razor page after it rendered completely by using javascript?

superTaylorfans Liu 26 Reputation points
2021-04-01T08:05:03.467+00:00

83624-mycode.jpg

I wrote this in my code, one of my test razor page.
<input value= "3"/>

83612-result.jpg

And after I run the project, in the WebPage I has saw the value is 3. But I saw in the DOM , it doesn't have value attribute.

So when I just use the DOM what I saw to create a html and open it, I could not see the value 3.

How can I get the DOM that include the input value;

Look forward your reply;

thanks

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,479 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jerry Cai-MSFT 986 Reputation points
    2021-04-02T07:40:14.75+00:00

    Hi,superTaylorfansLiu

    Do you mean you can't render the number 3 in html?

    Where did you get the number 3? you can set a parameter to put the number in and then it can be passed to other place, like this demo:

    z6EhW.png

    Result:

    HeAt4.gif

    About the model binding in blazor, you can check the official tutorial below:

    data-binding

    Best Regards,
    Jerry Cai


    If the answer is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful