Discussion:
ChatGPT "Credibility!"
Add Reply
Steve Carroll
2025-02-10 17:50:27 UTC
Reply
Permalink
For some goofy reason, some members of the QT let chatGPT do their
'thinking' for them now and their own 'thought processes' have
apparently been affected (atrophy?).

This was made evident when the topic of 'web dev' "Credibility!" was
brought up by a QT'er. While their *opinions* on that have been
challenged, it may be instructive to look at the source of their
'current thinking model' (here, I'm referring to them trying to 'do it'
on their own... 'sans AI').

With this 'look' in mind (and their 'current thinking model' placed in
the 'back of the closet'), here's an example of an issue with chatGPT's
'thinking' on something that should be trivial to it:

<Loading Image...>

If you (Apd ;) spot the issue, please don't point it out (it's fine to
point out you spotted it). For 'web dev professionals' (you know who you
are, Mr. Winner ;) if you can't spot it, it's probably because it's not
something you'd be thinking about. For "others", this is something that
would be *easily* overlooked because it's difficult to tell there's
anything wrong.


To facilitate you, I'll post the code:

let body = document.querySelector('body')

let list = document.createElement('ul')
body.appendChild(list) // This appends the list but doesn't return a reference

let item = document.createElement('li')
item.textContent = 'Item 1'

// Store the returned element in a variable
let appendedItem = list.appendChild(item)

// Now we can do something with the appended item
appendedItem.style.color = 'red' // This turns it red
David
2025-02-10 18:34:44 UTC
Reply
Permalink
Post by Steve Carroll
let body = document.querySelector('body')
let list = document.createElement('ul')
body.appendChild(list) // This appends the list but doesn't return a reference
let item = document.createElement('li')
item.textContent = 'Item 1'
// Store the returned element in a variable
let appendedItem = list.appendChild(item)
// Now we can do something with the appended item
appendedItem.style.color = 'red' // This turns it red
Your code looks correct! Here’s a breakdown of what’s happening:

1. You first select the `body` element using
`document.querySelector('body')`.

2. You create an unordered list (`ul`) element and append it to the `body`.

3. Then you create a list item (`li`) with text content of "Item 1".

4. You append the `item` to the `list` using `list.appendChild(item)`,
and this method returns the reference to the appended item (`item`),
which you store in the `appendedItem` variable.

5. Finally, you modify the style of `appendedItem` by changing its color
to red.

The key point is that `appendChild` returns the appended child element,
which you can store in a variable and use further, like you did with
`appendedItem.style.color`.

This approach ensures you can access and modify the item that was added
to the list. Everything should work as expected.
FromTheRafters
2025-02-14 09:44:00 UTC
Reply
Permalink
Post by Steve Carroll
For some goofy reason, some members of the QT let chatGPT do their
'thinking' for them now and their own 'thought processes' have
apparently been affected (atrophy?).
This was made evident when the topic of 'web dev' "Credibility!" was
brought up by a QT'er. While their *opinions* on that have been
challenged, it may be instructive to look at the source of their
'current thinking model' (here, I'm referring to them trying to 'do it'
on their own... 'sans AI').
With this 'look' in mind (and their 'current thinking model' placed in
the 'back of the closet'), here's an example of an issue with chatGPT's
<https://i.postimg.cc/Zq1vHjJ0/chatgpt-issue.gif>
If you (Apd ;) spot the issue, please don't point it out (it's fine to
point out you spotted it). For 'web dev professionals' (you know who you
are, Mr. Winner ;) if you can't spot it, it's probably because it's not
something you'd be thinking about. For "others", this is something that
would be *easily* overlooked because it's difficult to tell there's
anything wrong.
let body = document.querySelector('body')
let list = document.createElement('ul')
body.appendChild(list) // This appends the list but doesn't return a reference
let item = document.createElement('li')
item.textContent = 'Item 1'
// Store the returned element in a variable
let appendedItem = list.appendChild(item)
// Now we can do something with the appended item
appendedItem.style.color = 'red' // This turns it red
After some modifications, it works.
Steve Carroll
2025-02-14 16:24:41 UTC
Reply
Permalink
Post by FromTheRafters
Post by Steve Carroll
// Now we can do something with the appended item
appendedItem.style.color = 'red' // This turns it red
After some modifications, it works.
;)

Loading...