# How to access jQuery serialized data? (ok)

C:\xampp\htdocs\code\index.html

```
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.0/jquery.min.js"></script>
  <title>Document</title>
</head>
<body>
  <form id="example_form" action="">
    First name:
    <input type="text" name="FirstName" value="Foo" />
    <br>Last name:
    <input type="text" name="LastName" value="Bar" />
    <br>
  </form>
  <div id="results"></div>
  <script type="text/javascript">
  $(document).ready(function() {
    var $form = $('#example_form');
    var data = $form.serialize();
    console.log(data);
    var fakeURL = "http://localhost/code/index.html?" + data;
    var createURL = new URL(fakeURL);
    console.log(createURL);
    var FirstName = createURL.searchParams.get('FirstName');
    console.log(FirstName);
  });
  </script>
</body>
</html>
```

![](https://2726517656-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M1E4Gk2ppVKb4olmnun%2Fuploads%2F5QQoIV9eFhz3W494R7Ed%2FScreenshot_2.png?alt=media\&token=2408dd95-2d2d-4651-9069-6ffcd4cdb13c)
