Error in camera script

Hello

I was using a script to make a camera follow a gameobject, but target.transform doesn’t work and is marked as an error.

using UnityEngine;
using System.Collections;

public class CameraPlayer : MonoBehaviour {

    public GameObject targetl;
    public float xOffset = 0;
    public float yOffset = 0;
    public float zOffset = 0;

    void LateUpdate()
    {
        this.transform.position = new Vector3(target.transform.position.x + xOffset,
                                              target.transform.position.y + yOffset,
                                              target.transform.position.z + zOffset);
    }
    }

using UnityEngine;
using System.Collections;

 public class CameraPlayer : MonoBehaviour {

     public Transform target1;//attach the gameobject to this script
     public float xOffset = 0;
     public float yOffset = 0;
     public float zOffset = 0;
 
     void LateUpdate()
     {
         transform.position = new Vector3(target.position.x + xOffset,  target.position.y + yOffset, target.position.z + zOffset);
                                              
                                             
     }
     }